forked from moscowpython/python.ru
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (28 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
36 lines (28 loc) · 1.04 KB
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
FROM ubuntu:16.04
ARG version=dev
RUN export DEBIAN_FRONTEND=noninteractive && \
sed -i 's,http://archive.ubuntu.com/ubuntu/,mirror://mirrors.ubuntu.com/mirrors.txt,' /etc/apt/sources.list && \
apt-get update -qq && apt-get upgrade -qq && \
apt-get install -y --no-install-recommends \
python3 \
python3-setuptools \
python3-pip \
python3-psycopg2 \
nginx \
supervisor && \
BUILD_DEPS='build-essential python3-dev libxml2-dev libxslt-dev libssl-dev libffi-dev python-lxml zlib1g-dev git' && \
apt-get install -y --no-install-recommends ${BUILD_DEPS} && \
pip3 install -U setuptools wheel && \
pip3 install -U uwsgi
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
COPY etc/ /etc/
ADD requirements.txt /opt/requirements.txt
RUN pip3 install -r /opt/requirements.txt
COPY . /opt/app
WORKDIR /opt/app
RUN mkdir -p /opt/staticfiles
RUN python3 manage.py collectstatic --noinput
RUN apt-get autoremove -y ${BUILD_DEPS} \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 80
CMD ["supervisord", "-n"]