/
Dockerfile
28 lines (23 loc) · 1011 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
FROM ubuntu:bionic
ENV LANG C.UTF-8
ARG DEBIAN_FRONTEND=noninteractive
# Allow SECRET_KEY to be passed via arg so collectstatic can run during build time
ARG SECRET_KEY
# libpq-dev and python3-dev help with psycopg2
RUN apt-get update \
&& apt-get install -y python3.7-dev python3-pip libpq-dev curl \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*
# You can add additional steps to the build by appending commands down here using the
# format `&& <command>`. Remember to add a `\` at the end of LOC 12.
# WARNING: Changes to this file may cause unexpected behaviors when building the app.
# Change it at your own risk.
WORKDIR /opt/webapp
COPY . .
RUN pip3 install --no-cache-dir -q 'pipenv==2018.11.26' && pipenv install --deploy --system
RUN python3 manage.py collectstatic --no-input
# Run the image as a non-root user
RUN adduser --disabled-password --gecos "" django
USER django
# Run the web server on port $PORT
CMD waitress-serve --port=$PORT tiny_math_29517.wsgi:application