-
Notifications
You must be signed in to change notification settings - Fork 100
/
Dockerfile
executable file
·45 lines (41 loc) · 1.32 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# Docker file for CUBE image
#
# Build production image:
#
# docker build -t <name> .
#
# For example if building a local production image:
#
# docker build -t local/chris .
#
# Build development image:
#
# docker build --build-arg ENVIRONMENT=local -t <name>:<tag> .
#
# For example if building a local development image:
#
# docker build --build-arg ENVIRONMENT=local -t local/chris:dev .
#
# In the case of a proxy (located at say proxy.tch.harvard.edu:3128), do:
#
# export PROXY="http://proxy.tch.harvard.edu:3128"
#
# then add to any of the previous build commands:
#
# --build-arg http_proxy=${PROXY}
#
# For example if building a local development image:
#
# docker build --build-arg http_proxy=${PROXY} --build-arg ENVIRONMENT=local -t local/chris:dev .
#
FROM registry.access.redhat.com/ubi9/python-311:1-17.1692772360
COPY --chown=default:root ./requirements/ /tmp/requirements
ARG ENVIRONMENT=production
RUN pip install -r /tmp/requirements/$ENVIRONMENT.txt && rm -rf /tmp/requirements
COPY chris_backend/ ./
RUN if [ "$ENVIRONMENT" = "production" ]; then \
env DJANGO_SETTINGS_MODULE=config.settings.common ./manage.py collectstatic; fi
CMD ["daphne", "-b", "0.0.0.0", "-p", "8000", "config.asgi:application"]
HEALTHCHECK --interval=30s --timeout=5s \
CMD curl -f http://localhost:8000/api/v1/users/ || exit 1