-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (29 loc) · 1.12 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
############################################################
# Dockerfile to build Flask App
# Based on
############################################################
# Set the base image
FROM debian:latest
# File Author / Maintainer
MAINTAINER Carlos Tighe
COPY ./nginx_signing.key /var/www/app/nginx_signing.key
RUN apt-key add /var/www/app/nginx_signing.key
RUN echo "deb http://nginx.org/packages/debian/ jessie nginx" >> /etc/apt/sources.list
RUN echo "deb-src http://nginx.org/packages/debian/ jessie nginx" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -y nginx \
build-essential \
python \
python-dev\
python-pip \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/lib/apt/lists/*
# Copy over and install the requirements
COPY ./app/requirements.txt /var/www/app/app/requirements.txt
RUN pip install -r /var/www/app/app/requirements.txt
COPY ./run.py ./uwsgi.ini ./app.conf /var/www/app/
RUN rm /etc/nginx/conf.d/default.conf && ln -s /var/www/app/app.conf /etc/nginx/conf.d/
COPY ./app /var/www/app/app/
WORKDIR /var/www/app
EXPOSE 80
CMD ["/bin/bash", "-c", "nginx; uwsgi uwsgi.ini"]