Updated docker files

This commit is contained in:
Francesco Siddi 2015-10-21 15:33:44 +02:00
parent 322530761e
commit cbccc3b94a
6 changed files with 49 additions and 42 deletions

17
docker/build.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $DIR
if [[ $1 == 'pro' || $1 == 'dev' ]]; then
# Copy requirements.txt into pro folder
cp ../requirements.txt $1/requirements.txt
# Build image
docker build -t armadillica/pillar_$1 $1
# Remove requirements.txt
rm $1/requirements.txt
else
echo "POS. Your options are 'pro' or 'dev'"
fi

View File

@ -1,11 +1,10 @@
FROM ubuntu
FROM ubuntu:14.04
MAINTAINER Francesco Siddi <francesco@blender.org>
RUN apt-get update && apt-get install -y \
python \
python-dev \
python-pip \
git \
nano \
zlib1g-dev \
libjpeg-dev \
@ -19,28 +18,24 @@ 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 mkdir -p /data/git/pillar \
&& mkdir -p /data/storage/shared \
&& mkdir -p /data/storage/pillar \
&& mkdir -p /data/config \
&& mkdir -p /data/storage/logs
RUN pip install virtualenv \
&& virtualenv /data/venv
RUN . /data/venv/bin/activate && pip install -r /data/www/pillar/requirements.txt
VOLUME /data/dev/pillar
ENV PIP_PACKAGES_VERSION = 1
ADD requirements.txt /requirements.txt
RUN . /data/venv/bin/activate && pip install -r /requirements.txt
VOLUME /data/git/pillar
VOLUME /data/config
VOLUME /storage/shared
VOLUME /storage/pillar
VOLUME /data/storage/shared
VOLUME /data/storage/pillar
ENV MONGO_HOST mongo_pillar

View File

@ -1,3 +1,3 @@
#!/bin/bash
. /data/venv/bin/activate && python /data/dev/pillar/pillar/manage.py runserver
. /data/venv/bin/activate && python /data/git/pillar/pillar/manage.py runserver

View File

@ -10,7 +10,7 @@
# EnableSendfile on
XSendFile on
XSendFilePath /storage/pillar
XSendFilePath /data/storage/pillar
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
@ -34,10 +34,10 @@
WSGIDaemonProcess pillar
WSGIPassAuthorization On
WSGIScriptAlias / /data/dev/pillar/pillar/runserver.wsgi \
WSGIScriptAlias / /data/git/pillar/pillar/runserver.wsgi \
process-group=pillar application-group=%{GLOBAL}
<Directory /data/dev/pillar/pillar>
<Directory /data/git/pillar/pillar>
<Files runserver.wsgi>
Require all granted
</Files>

View File

@ -5,7 +5,6 @@ RUN apt-get update && apt-get install -y \
python \
python-dev \
python-pip \
git \
vim \
nano \
zlib1g-dev \
@ -23,16 +22,11 @@ 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 mkdir -p /data/git/pillar \
&& mkdir -p /data/storage/shared \
&& mkdir -p /data/storage/pillar \
&& mkdir -p /data/config \
&& mkdir -p /data/storage/logs
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
@ -43,18 +37,19 @@ ENV APACHE_LOCK_DIR /var/lock/apache2
RUN mkdir -p $APACHE_RUN_DIR $APACHE_LOCK_DIR $APACHE_LOG_DIR
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
ENV PIP_PACKAGES_VERSION = 1
ADD requirements.txt /requirements.txt
VOLUME /data/dev/pillar
RUN . /data/venv/bin/activate \
&& pip install -r /requirements.txt
VOLUME /data/git/pillar
VOLUME /data/config
VOLUME /storage/shared
VOLUME /storage/pillar
VOLUME /data/storage/shared
VOLUME /data/storage/pillar
ENV MONGO_HOST mongo_pillar

View File

@ -218,7 +218,7 @@ client = MongoClient(app.config['MONGO_HOST'], 27017)
db = client.eve
bugsnag.configure(
api_key = app.config['BUGSNAG_API_KEY'],
project_root = "/date/dev/pillar/pillar",
project_root = "/data/dev/pillar/pillar",
)
handle_exceptions(app)