-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (24 loc) · 914 Bytes
/
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
FROM python:3.6
LABEL maintainer="[email protected]"
ENV PYTHONUNBUFFERED 1
ENV DJANGO_ENV dev
RUN apt update && \
apt install -y nginx && \
rm -v /etc/nginx/nginx.conf && \
rm -v /etc/nginx/sites-enabled/default && \
chown -R www-data:www-data /var/lib/nginx /var/log/nginx && \
chmod -R 777 /var/lib/nginx /var/log/nginx
COPY ./nginx.conf /etc/nginx/
COPY ./requirements.txt /code/requirements.txt
RUN pip install -r /code/requirements.txt && \
pip install gunicorn
COPY ./photography /code/
WORKDIR /code
RUN mkdir /code/logs && \
touch /code/logs/access.log /code/logs/error.log && \
python manage.py collectstatic && \
# python manage.py migrate && \
useradd wagtail && \
chown -R wagtail /code
EXPOSE 80
CMD /etc/init.d/nginx start && gunicorn --access-logfile - --workers 3 --bind 127.0.0.1:8000 --chdir /code/photography photography.wsgi:application