-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
57 lines (42 loc) · 1.48 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM python:3.8.14-alpine
LABEL maintainer="Napho <[email protected]>"
RUN apk add postgresql-client && \
set -ex \
&& apk add gcc \
g++ \
make \
libc-dev \
musl-dev \
linux-headers \
pcre-dev \
postgresql-dev \
git
RUN apk add python3-dev
RUN apk add --no-cache python3 && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi
# Require to compile psycopg2
RUN apk add --no-cache jpeg-dev zlib-dev
RUN apk add --no-cache postgresql-dev
RUN apk add --no-cache libmemcached-dev zlib-dev
# Required for python cryptography
RUN apk add --no-cache libressl-dev libffi-dev python3-dev
# Required for python lxml
RUN apk add --no-cache libxslt-dev
# Required for webp images
RUN apk add --no-cache libwebp libwebp-tools
# Set environment varibles
ENV PYTHONUNBUFFERED 1
ENV DJANGO_ENV dev
WORKDIR /code/
COPY ./requirements.txt /code/
RUN apk add --no-cache --virtual .build-deps build-base linux-headers \
&& pip install pip --upgrade \
&& pip install -r /code/requirements.txt \
&& apk del .build-deps
RUN apk add --no-cache bash
#Install nvm to be used by user wagail
EXPOSE 8090
# start uWSGI, using a wrapper script to allow us to easily add more commands to container startup:
ENTRYPOINT ["/code/docker-entrypoint.sh"]
CMD ["gunicorn","di_website.wsgi:application","--bind","0.0.0.0:8090","--workers","4","--worker-class","gevent","--worker-connections","10"]