From: Thomas Fillon Date: Tue, 3 Mar 2015 11:16:29 +0000 (+0100) Subject: Docker-compose: switch to debian:wheezy as base image, try manage media through nginx X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=091a85f5cd91b6eb7a05f81b662ea12abd4b6301;p=timeside.git Docker-compose: switch to debian:wheezy as base image, try manage media through nginx --- diff --git a/Dockerfile b/Dockerfile index 742d6fa..7c745fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM debian:stable +FROM debian:wheezy MAINTAINER Guillaume Pellerin , Thomas fillon diff --git a/docker-compose.yml b/docker-compose.yml index f26e63c..5eef9e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,23 @@ datadb: - image: debian:stable + image: debian:wheezy volumes: - /var/lib/postgresql command: /bin/true -datastatic: - image: debian:stable +datamedia: + image: debian:wheezy volumes: - - /var/www + - /media command: /bin/true +datastatic: + image: debian:wheezy + volumes: + - /var/www/static + command: true + datalog: - image: debian:stable + image: debian:wheezy volumes: - /var/log/nginx - /var/log/postgres @@ -30,7 +36,10 @@ nginx: volumes: - ./examples/deploy/nginx/sites-enabled/app.conf:/etc/nginx/conf.d/default.conf - /media - - ./examples/deploy/static/:/var/www/static + #- ./examples/deploy/static/:/var/www/static + volumes_from: + - datastatic + - datamedia links: - app @@ -38,7 +47,10 @@ app: build: . volumes: - .:/opt/TimeSide - - ./examples/deploy/static/:/var/www/static + #- ./examples/deploy/static/:/var/www/static + volumes_from: + - datastatic + - datamedia command: /opt/TimeSide/examples/sandbox/manage.py collectstatic command: uwsgi --socket :8000 --wsgi-file /opt/TimeSide/examples/sandbox/wsgi.py --chdir /opt/TimeSide/examples/sandbox/ --master --processes 4 --threads 2 expose: diff --git a/examples/deploy/nginx/sites-enabled/app.conf b/examples/deploy/nginx/sites-enabled/app.conf index b401d7c..9c41879 100644 --- a/examples/deploy/nginx/sites-enabled/app.conf +++ b/examples/deploy/nginx/sites-enabled/app.conf @@ -11,7 +11,11 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; - + + # Django media + location /media { + alias /media; # your Django project's media files - amend as required + } # Django static location /static { alias /var/www/static; # your Django project's static files - amend as required