From 7dd5b23bb77bc36f676c05e6ab75bd00c10167e2 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Mon, 16 Mar 2015 15:07:18 +0100 Subject: [PATCH] Docker-compose: clean-up Dockerfile (to improve cache) and add .dockerignore file --- .dockerignore | 7 +++++++ Dockerfile | 31 ++++++++++++++---------------- docker-compose.yml | 48 ++++++++++++++++++++++++---------------------- 3 files changed, 46 insertions(+), 40 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..da6bc14 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +*.pyc +*.egg-info +build/ +dist/ +examples/sandbox/media +examples/sanbox/timeside.sql \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5cf29af..5d5b91c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,24 +19,21 @@ MAINTAINER Guillaume Pellerin , Thomas fillon /etc/apt/sources.list.d/wheezy-backports.list && \ + echo 'deb http://debian.parisson.com/debian/ wheezy main' > /etc/apt/sources.list.d/parisson.list && \ + apt-get update && \ + apt-get -y --force-yes -t wheezy-backports dist-upgrade && \ + apt-get install -y --force-yes python-gst0.10 gstreamer0.10-plugins-good gstreamer0.10-gnonlin gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-alsa vamp-examples && \ + apt-get install -y --force-yes -t wheezy-backports python-yaafe && \ + apt-get install -y --force-yes wget bzip2 build-essential && \ + apt-get clean # Install conda in /opt/miniconda +ENV PATH /opt/miniconda/bin:$PATH RUN wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh && \ bash miniconda.sh -b -p /opt/miniconda && \ - rm miniconda.sh -ENV PATH /opt/miniconda/bin:$PATH -RUN hash -r && \ + rm miniconda.sh && \ + hash -r && \ conda config --set always_yes yes --set changeps1 yes && \ conda update -q conda @@ -73,8 +70,8 @@ RUN pip install -r requirements.txt #RUN cd /opt/TimeSide; python setup.py develop # Sandbox setup -RUN /opt/TimeSide/examples/sandbox/manage.py syncdb --noinput -RUN /opt/TimeSide/examples/sandbox/manage.py migrate --noinput -RUN /opt/TimeSide/examples/sandbox/manage.py collectstatic --noinput +RUN /opt/TimeSide/examples/sandbox/manage.py syncdb --noinput && \ + /opt/TimeSide/examples/sandbox/manage.py migrate --noinput && \ + /opt/TimeSide/examples/sandbox/manage.py collectstatic --noinput EXPOSE 8000 diff --git a/docker-compose.yml b/docker-compose.yml index 3755115..9da2d60 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,3 @@ -home: - image: debian:wheezy - volumes: - - ./examples/sandbox:/home/timeside - command: /bin/true - static: image: debian:wheezy volumes: @@ -26,7 +20,6 @@ lib: - /var/lib/mysql command: /bin/true - # db: # image: postgres # volumes_from: @@ -39,22 +32,6 @@ rabbitmq: expose: - "5672" -app: - build: . - volumes: - - .:/opt/TimeSide - volumes_from: - - static - - home - - log - command: /bin/sh /opt/TimeSide/examples/deploy/start_app.sh - ports: - - "9000:9000" - expose: - - "8000" #default runserver wsgi port - links: - - rabbitmq - worker: build: . volumes_from: @@ -64,6 +41,9 @@ worker: - rabbitmq - app + +# --- TimeSide containers --- + nginx: image: nginx ports: @@ -77,3 +57,25 @@ nginx: links: - app +home: + image: debian:wheezy + volumes: + - ./examples/sandbox:/home/timeside + command: /bin/true + +app: + build: . + volumes: + - .:/opt/TimeSide + volumes_from: + - static + - home + - log + command: /bin/sh /opt/TimeSide/examples/deploy/start_app.sh + ports: + - "9000:9000" + expose: + - "8000" #default runserver wsgi port + links: + - rabbitmq + -- 2.39.5