-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
51 lines (35 loc) · 1.43 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
46
47
48
49
50
51
# ==============================
FROM registry.access.redhat.com/ubi9/python-311 AS appbase
# ==============================
USER root
WORKDIR /app
RUN mkdir /entrypoint
COPY --chown=default:root requirements.txt /app/requirements.txt
COPY --chown=default:root requirements-prod.txt /app/requirements-prod.txt
RUN yum update -y && yum install -y \
nc \
&& pip install -U pip \
&& pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir -r /app/requirements-prod.txt
COPY --chown=default:root docker-entrypoint.sh /entrypoint/docker-entrypoint.sh
ENTRYPOINT ["/entrypoint/docker-entrypoint.sh"]
# ==============================
FROM appbase AS development
# ==============================
COPY --chown=default:root requirements-dev.txt /app/requirements-dev.txt
RUN pip install --no-cache-dir -r /app/requirements-dev.txt
ENV DEV_SERVER=1
COPY --chown=default:root . /app/
# fatal: detected dubious ownership in repository at '/app'
RUN git config --system --add safe.directory /app
USER default
EXPOSE 8081/tcp
# ==============================
FROM appbase AS production
# ==============================
COPY --chown=default:root . /app/
# fatal: detected dubious ownership in repository at '/app'
RUN git config --system --add safe.directory /app
RUN SECRET_KEY="only-used-for-collectstatic" KUKKUU_HASHID_SALT="only-used-for-collectstatic" python manage.py collectstatic
USER default
EXPOSE 8000/tcp