-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
56 lines (44 loc) · 1.77 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
FROM python:3.7
LABEL maintainer="Joe Bryan <[email protected]>"
RUN apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests \
systemd \
nginx \
nano \
apt-utils \
software-properties-common \
default-mysql-client \
default-libmysqlclient-dev \
supervisor && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
RUN rm /requirements.txt
RUN rm -rf /etc/nginx/sites-enabled/default
RUN rm -rf /etc/nginx/sites-available/default
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/default.conf /etc/nginx/sites-available/default.conf
COPY nginx/sosapp.live.conf /etc/nginx/sites-available/sosapp.conf
COPY nginx/qsapp.live.conf /etc/nginx/sites-available/qsapp.conf
COPY nginx/marut.live.conf /etc/nginx/sites-available/marut.conf
RUN ln -sf /etc/nginx/sites-available/default.conf /etc/nginx/sites-enabled/default.conf
RUN ln -sf /etc/nginx/sites-available/sosapp.conf /etc/nginx/sites-enabled/sosapp.conf
RUN ln -sf /etc/nginx/sites-available/qsapp.conf /etc/nginx/sites-enabled/qsapp.conf
RUN ln -sf /etc/nginx/sites-available/marut.conf /etc/nginx/sites-enabled/marut.conf
RUN [ -f /etc/ssl/certs/dhparam.pem ] || openssl dhparam -dsaparam -out /etc/ssl/certs/dhparam.pem 4096
# Disable nginx upstart/systemd
RUN update-rc.d -f nginx remove
RUN rm -rf /etc/init/nginx.conf && rm -rf /etc/init.d/nginx
# Add uwsgi.ini into /etc/uwsgi after creating directory
RUN mkdir /etc/uwsgi
RUN mkdir /var/log/uwsgi
RUN mkdir /var/log/uwsgi/app
RUN chmod a+w -R /var/log/uwsgi/app/
COPY wsgi/*.ini /etc/uwsgi/
COPY supervisord.conf /etc/supervisord.conf
ENV MYSQL_HOST='django-apps-mysql'
WORKDIR /var/www/
EXPOSE 80
EXPOSE 443
CMD ["/usr/bin/supervisord"]