]> git.parisson.com Git - timeside.git/commitdiff
Docker-compose: switch to debian:wheezy as base image, try manage media through nginx
authorThomas Fillon <thomas@parisson.com>
Tue, 3 Mar 2015 11:16:29 +0000 (12:16 +0100)
committerThomas Fillon <thomas@parisson.com>
Tue, 3 Mar 2015 11:16:29 +0000 (12:16 +0100)
Dockerfile
docker-compose.yml
examples/deploy/nginx/sites-enabled/app.conf

index 742d6fabf4ad0b7f3d6fbe1ce291f5bb4387ae5a..7c745fd2a69b64d16a6f4c7494aeb50269d18fab 100644 (file)
@@ -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 <yomguy@parisson.com>, Thomas fillon <thomas@parisson.com>
 
index f26e63cf954b51532656bbbebbfe872fb5207181..5eef9e462a6db0d7d8d9264653f00494038594e7 100644 (file)
@@ -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:
index b401d7c91468b758a98cf882d16b53d84a5fc0c6..9c418792fcd3dc9433daca9c08887ae1475eb09a 100644 (file)
@@ -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