-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-debian8
40 lines (30 loc) · 975 Bytes
/
Dockerfile-debian8
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 debian:jessie
MAINTAINER Adriano Vieira <adriano.svieira at gmail.com>
# install base packs
# apache.wsgi python pip
RUN apt-get clean && apt-get update ; \
apt-get install -y apache2 libapache2-mod-wsgi python-pip python-dev; \
apt-get clean ; \
pip install --upgrade pip
# enable apache modules
RUN a2enmod wsgi rewrite
# setup apache environment
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
# setup apache default wsgi vhost
COPY setup/apache2-vhost-wsgi.conf /etc/apache2/sites-available/000-default.conf
# expose apache port
EXPOSE 80
# clean apt cache
RUN apt-get clean
# pip install app requirements
COPY code/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# upload app to image
ADD code /var/www/html
WORKDIR /var/www/html
# run flask app on apache
CMD /usr/sbin/apache2ctl -D FOREGROUND