-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
29 lines (21 loc) · 835 Bytes
/
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
FROM crowdbotics/cb-django:3.8-slim-buster AS build
# Copy dependency management files and install app packages to /.venv
COPY ./Pipfile ./Pipfile.lock /
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
FROM crowdbotics/cb-django:3.8-slim-buster AS release
ARG SECRET_KEY
# Set Working directory
WORKDIR /opt/webapp
# Add runtime user with respective access permissions
RUN groupadd -r django \
&& useradd -d /opt/webapp -r -g django django \
&& chown django:django -R /opt/webapp
USER django
# Copy virtual env from build stage
COPY --chown=django:django --from=build /.venv /.venv
ENV PATH="/.venv/bin:$PATH"
# Copy app source
COPY --chown=django:django . .
# Collect static files and serve app
RUN python3 manage.py collectstatic --no-input
CMD waitress-serve --port=$PORT online_king_money_a_38819.wsgi:application