forked from moscowpython/learnpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (24 loc) · 856 Bytes
/
Dockerfile
File metadata and controls
31 lines (24 loc) · 856 Bytes
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
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update -qq && apt-get upgrade -qq && \
apt-get install -y --no-install-recommends \
nginx \
supervisor && \
BUILD_DEPS='build-essential python3-dev git' && \
apt-get install -y --no-install-recommends ${BUILD_DEPS} && \
pip3 install -U pip setuptools && \
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 landing_page /opt/app
WORKDIR /opt/app
RUN mkdir -p /opt/app/static
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"]