-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·43 lines (36 loc) · 1.28 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
FROM python:2.7.12
MAINTAINER [email protected]
RUN apt-get update && apt-get install -y \
gcc gettext mysql-client libmysqlclient-dev \
postgresql-client libpq-dev sqlite3 \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV DJANGO_VERSION 1.10.4
RUN pip install mysqlclient psycopg2 django=="$DJANGO_VERSION"
ENV NGINX_VERSION 1.6.2-5+deb8u4
ENV GUNICORN_VERSION 19.4.1
ENV SUPERVISOR_VERSION 3.1.0
ENV APP_ROOT /opt/app
# Define working directory.
RUN mkdir -p ${APP_ROOT}
# install common tools
RUN apt-get update && apt-get install -y net-tools curl wget vim git
RUN pip install --upgrade pip
# install nginx
RUN apt-get update && apt-get install -y nginx=${NGINX_VERSION}
RUN rm /etc/nginx/sites-enabled/default
RUN ln -s /opt/app/nginx/django_config /etc/nginx/sites-enabled/default
# install gunicorn
RUN pip install gunicorn==${GUNICORN_VERSION}
# install supervisor
RUN pip install supervisor==${SUPERVISOR_VERSION}
RUN echo_supervisord_conf > /etc/supervisord.conf
RUN mkdir -p /etc/supervisord.d
RUN echo '\
[include]\n\
files = /etc/supervisord.d/*.conf'\
>> /etc/supervisord.conf
RUN ln -s /opt/app/supervisor/supervisor.conf /etc/supervisord.d/supervisor.conf
WORKDIR ${APP_ROOT}
VOLUME ['${APP_ROOT}']
EXPOSE 80 443 8080 8000
CMD ["/usr/local/bin/supervisord"]