-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (30 loc) · 1.25 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
FROM ubuntu:14.04
MAINTAINER [email protected]
MAINTAINER [email protected]
RUN apt-get update --fix-missing
RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
RUN apt-get install -y openssh-server
RUN mkdir -p /var/run/sshd
RUN apt-get install -y nginx
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libapache2-mod-uwsgi build-essential git sqlite3 supervisor libpq-dev libmysqlclient-dev postgresql mysql-client
RUN apt-get install -y python python-pip python-dev python-setuptools uwsgi-plugin-python
ADD provision.sh /provision.sh
RUN /provision.sh && rm -f /provision.sh
RUN rm /etc/nginx/sites-enabled/default
RUN mkdir -p /opt/django/app
ADD uwsgi_params /opt/uwsgi/uwsgi_params
ADD uwsgi.ini /opt/uwsgi/uwsgi.ini
COPY config /config
COPY nginx.conf /etc/nginx/sites-enabled/nginx.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY sudoers /etc/sudoers
# nginx config
RUN sed -i -e"s/keepalive_timeout\s*65/keepalive_timeout 2/" /etc/nginx/nginx.conf
RUN sed -i -e"s/keepalive_timeout 2/keepalive_timeout 2;\n\tclient_max_body_size 100m/" /etc/nginx/nginx.conf
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
ADD run.sh /run.sh
ADD startup.sh /startup.sh
RUN chmod 755 /*.sh
EXPOSE 22 80
CMD ["/run.sh"]