-
Notifications
You must be signed in to change notification settings - Fork 2
/
django.dockerfile
32 lines (24 loc) · 990 Bytes
/
django.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
FROM python:3.7.1-alpine
LABEL purpose="Python container for CRON, logging and Django"
ARG BUILD_ENVIRONMENT
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Specify environment variables that should be
# present inside of the container. Default them
# to 'NA' if they are not available.
ENV ENVIRONMENT=${ENVIRONMENT:-production}
ENV DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-config.settings.${ENVIRONMENT}}
WORKDIR /usr/local/etc
COPY requirements requirements
# Install System Level Dependencies
# Installing client libraries and any other package you need
RUN apk update && apk add libpq make
# Installing build dependencies
RUN apk add --virtual .build-deps gcc python-dev musl-dev postgresql-dev tzdata
RUN cp /usr/share/zoneinfo/America/Indianapolis /etc/localtime
RUN echo "America/Indianapolis" > /etc/timezone
RUN apk del tzdata
RUN pip install -r requirements/${BUILD_ENVIRONMENT}.txt
# Delete build dependencies
RUN apk del .build-deps
WORKDIR /usr/src/app