| 1 |
ARG PYTHON_VERSION |
| 2 |
FROM python:${PYTHON_VERSION} |
| 3 |
LABEL vendor="dProg - Philippe Docourt" maintainer="Philippe Docourt" description="Demo Site for Django QR code" |
| 4 |
|
| 5 |
ENV PYTHONUNBUFFERED 1 |
| 6 |
|
| 7 |
# Avoid possible occurrences of UnicodeEncodeError when running on x86 architecture. |
| 8 |
ENV PYTHONIOENCODING utf-8 |
| 9 |
|
| 10 |
# Set env variables used in this Dockerfile (add a unique prefix, such as <app name>) |
| 11 |
# Directory in container for project source files. |
| 12 |
ARG APP_BASE_DIR=/usr/src/app |
| 13 |
|
| 14 |
# Declare a proper Django settings file. |
| 15 |
ENV DJANGO_SETTINGS_MODULE=demo_site.settings |
| 16 |
|
| 17 |
# Make app dir. |
| 18 |
RUN mkdir -p "$APP_BASE_DIR" |
| 19 |
WORKDIR "$APP_BASE_DIR" |
| 20 |
|
| 21 |
# Install requirements (separate step for caching intermediate image). |
| 22 |
COPY requirements.txt "$APP_BASE_DIR/" |
| 23 |
RUN pip install --upgrade pip |
| 24 |
RUN pip install -r requirements.txt |
| 25 |
COPY requirements-web-deployment.txt "$APP_BASE_DIR/" |
| 26 |
RUN pip install -r requirements-web-deployment.txt |
| 27 |
|
| 28 |
# Copy entrypoint script into the image. |
| 29 |
COPY ./docker-entrypoint.sh / |
| 30 |
|
| 31 |
# Invoke app's entrypoint via dumb-init so that sub-processes are handled properly. |
| 32 |
CMD ["/docker-entrypoint.sh"] |