From dc215134fc8c20db7334ecc9c7983b5a395870ff Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Wed, 7 Oct 2015 11:10:58 +0200 Subject: [PATCH] New Dockerfiles for development and production --- docker/{ => dev}/Dockerfile | 0 docker/{ => dev}/runserver.sh | 0 docker/pro/000-default.conf | 43 +++++++++++++++++++++++++++ docker/pro/Dockerfile | 55 +++++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+) rename docker/{ => dev}/Dockerfile (100%) rename docker/{ => dev}/runserver.sh (100%) create mode 100644 docker/pro/000-default.conf create mode 100644 docker/pro/Dockerfile diff --git a/docker/Dockerfile b/docker/dev/Dockerfile similarity index 100% rename from docker/Dockerfile rename to docker/dev/Dockerfile diff --git a/docker/runserver.sh b/docker/dev/runserver.sh similarity index 100% rename from docker/runserver.sh rename to docker/dev/runserver.sh diff --git a/docker/pro/000-default.conf b/docker/pro/000-default.conf new file mode 100644 index 00000000..72d6c4e8 --- /dev/null +++ b/docker/pro/000-default.conf @@ -0,0 +1,43 @@ + + # The ServerName directive sets the request scheme, hostname and port that + # the server uses to identify itself. This is used when creating + # redirection URLs. In the context of virtual hosts, the ServerName + # specifies what hostname must appear in the request's Host: header to + # match this virtual host. For the default virtual host (this file) this + # value is not decisive as it is used as a last resort host regardless. + # However, you must set it for any further virtual host explicitly. + #ServerName 127.0.0.1 + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf + + WSGIDaemonProcess pillar-web + WSGIPassAuthorization On + + WSGIScriptAlias / /data/dev/pillar-web/pillar-web/runserver.wsgi \ + process-group=pillar-web application-group=%{GLOBAL} + + + + Require all granted + + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/docker/pro/Dockerfile b/docker/pro/Dockerfile new file mode 100644 index 00000000..e616e26a --- /dev/null +++ b/docker/pro/Dockerfile @@ -0,0 +1,55 @@ +FROM ubuntu:14.04 +MAINTAINER Francesco Siddi + +RUN apt-get update && apt-get install -y \ +python \ +python-dev \ +python-pip \ +git \ +vim \ +nano \ +zlib1g-dev \ +libjpeg-dev \ +python-crypto \ +python-openssl \ +libssl-dev \ +libffi-dev \ +software-properties-common \ +apache2-mpm-event \ +libapache2-mod-wsgi + +RUN add-apt-repository ppa:mc3man/trusty-media \ +&& apt-get update && apt-get install -y \ +ffmpeg + +RUN mkdir /data \ +&& mkdir /data/www \ +&& mkdir /data/www/pillar \ +&& mkdir /data/dev \ +&& mkdir /data/dev/pillar \ +&& mkdir /storage \ +&& mkdir /storage/shared \ +&& mkdir /storage/pillar \ +&& mkdir /data/config \ +&& mkdir /storage/logs + +RUN git clone https://github.com/armadillica/pillar.git /data/www/pillar + +RUN pip install virtualenv \ +&& virtualenv /data/venv + +RUN . /data/venv/bin/activate \ +&& pip install -r /data/www/pillar/requirements.txt + +VOLUME /data/dev/pillar +VOLUME /data/config +VOLUME /storage/shared +VOLUME /storage/pillar + +ENV MONGO_HOST mongo_pillar + +EXPOSE 5000 + +ADD 000-default.conf /etc/apache2/sites-available/000-default.conf + +CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]