-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (27 loc) · 957 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
32
33
34
FROM ubuntu:14.04
MAINTAINER Fausto Carrera <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
# Install necessary software
RUN apt-get update
RUN apt-get install -y python-pip python-dev uwsgi-plugin-python
RUN apt-get install -y nginx
RUN apt-get install -y supervisor
# Copy files
COPY nginx/flask.conf /etc/nginx/sites-available/
COPY supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY app /var/www
# Create neccesary folders
RUN mkdir -p /var/log/nginx/app
RUN mkdir -p /var/log/uwsgi/app
RUN mkdir -p /var/log/supervisor
# Change permissions
RUN chown -R www-data:www-data /var/www
RUN chown -R www-data:www-data /var/log
# finish setup
RUN rm /etc/nginx/sites-enabled/default
RUN ln -s /etc/nginx/sites-available/flask.conf /etc/nginx/sites-enabled/flask.conf
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt
# run
CMD ["/usr/bin/supervisord"]