-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-alpine
41 lines (32 loc) · 1.02 KB
/
Dockerfile-alpine
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
# pull official python alpine image
FROM python:3.7-alpine
# Set Environment Variable
ENV PYTHONUNBUFFERED 1
ENV C_FORCE_ROOT true
RUN mkdir -p /opt/django/dev
# Creating Work Directory
WORKDIR /opt/django/dev
# Adding mandatory packages to docker
RUN apk update && apk add --no-cache \
mariadb-dev \
zlib \
jpeg
# Installing temporary packages required for installing requirements.pip
RUN apk add --no-cache --virtual build-deps \
gcc \
python3-dev \
musl-dev \
zlib-dev \
jpeg-dev
# Update pip
RUN pip install --upgrade pip
# Installing requirements.pip from project
ADD dev/requirements/production.txt /opt/django/dev/
RUN pip install --no-cache-dir -r production.txt
ADD dev/ /opt/django/dev/
# removing temporary packages from docker and removing cache
RUN apk del build-deps && \
find -type d -name __pycache__ -prune -exec rm -rf {} \; && \
rm -rf ~/.cache/pip
# CMD will run when this dockerfile is running
CMD ["sh", "-c", "gunicorn -b :80 --workers=3 config.wsgi:application"]