]> git.parisson.com Git - timeside.git/commitdiff
Docker-compose: change media container to home and move sandbox to /home/timeside
authorThomas Fillon <thomas@parisson.com>
Thu, 12 Mar 2015 14:04:23 +0000 (15:04 +0100)
committerThomas Fillon <thomas@parisson.com>
Thu, 12 Mar 2015 14:04:23 +0000 (15:04 +0100)
Dockerfile
docker-compose.yml
examples/deploy/nginx-app.conf [new file with mode: 0644]
examples/deploy/nginx/sites-enabled/app.conf [deleted file]
examples/deploy/start_app.sh

index 919c00621842efcd32218f06f3475c1216df0008..bf0bc402461b3901a278b3da76035ed8a06373b6 100644 (file)
@@ -50,7 +50,7 @@ WORKDIR /opt/TimeSide
 
 # Install binary dependencies with conda
 ADD conda-requirements.txt /opt/TimeSide/
-ADD requirements.txt /opt/TimeSide/
+#ADD requirements.txt /opt/TimeSide/
 RUN conda install --file conda-requirements.txt  && \
     rm /opt/miniconda/lib/libm.so.6  # use the system libm; see github.com/ContinuumIO/anaconda-issues/issues/182
 
@@ -66,12 +66,6 @@ WORKDIR /opt/TimeSide
 
 RUN pip install -r requirements.txt
 
-# setup all the configfiles  --> GĂ©rer dans le container Nginx
-#RUN echo "daemon off;" >> /etc/nginx/nginx.conf
-#RUN rm /etc/nginx/sites-enabled/default
-#RUN ln -s /opt/TimeSide/examples/deploy/nginx-app.conf /etc/nginx/sites-enabled/
-#RUN ln -s /opt/TimeSide/examples/deploy/supervisor-app.conf /etc/supervisor/conf.d/
-
 # install new deps from the local repo
 #RUN pip install -e /opt/TimeSide
 
@@ -84,4 +78,3 @@ RUN /opt/TimeSide/examples/sandbox/manage.py migrate --noinput
 RUN /opt/TimeSide/examples/sandbox/manage.py collectstatic --noinput
 
 EXPOSE 8000
-#CMD ["supervisord", "-n"]
index 22fc69378b8366b49f0f3d72292be3eeb8a4e1f6..5067dfe1eb8b28e5a43e33535ae1af11d7363c96 100644 (file)
@@ -1,7 +1,7 @@
-media:
+home:
   image: debian:wheezy
   volumes:
-    - ./examples/sandbox/media:/media
+    - ./examples/sandbox:/home/timeside
   command: /bin/true
 
 static:
@@ -34,10 +34,10 @@ nginx:
   ports:
     - "8000:80"
   volumes:
-    - ./examples/deploy/nginx/sites-enabled/app.conf:/etc/nginx/conf.d/default.conf
+    - ./examples/deploy/nginx-app.conf:/etc/nginx/conf.d/default.conf
   volumes_from:
     - static
-    - media
+    - home
     - log
   links:
     - app
@@ -48,7 +48,7 @@ app:
     - .:/opt/TimeSide
   volumes_from:
     - static
-    - media
+    - home
     - log
   command: /bin/sh /opt/TimeSide/examples/deploy/start_app.sh
   ports:
diff --git a/examples/deploy/nginx-app.conf b/examples/deploy/nginx-app.conf
new file mode 100644 (file)
index 0000000..6d495f3
--- /dev/null
@@ -0,0 +1,30 @@
+server_tokens off;
+
+server {
+       listen 80;
+       server_name nginx;
+       charset utf-8;
+
+       access_log /var/log/nginx/app-access.log;
+       error_log /var/log/nginx/app-error.log;
+
+       # max upload size
+       client_max_body_size 75M; # adjust to taste
+
+       # Django media
+       location /media {
+                       alias /home/timeside/media; # your Django project's media files - amend as required
+                autoindex on;
+       }
+       # Django static
+       location /static {
+               alias /var/www/static; # your Django project's static files - amend as required
+               autoindex on;
+       }
+
+       location / {
+            uwsgi_pass app:8000;
+            include /etc/nginx/uwsgi_params;
+       }
+}
+
diff --git a/examples/deploy/nginx/sites-enabled/app.conf b/examples/deploy/nginx/sites-enabled/app.conf
deleted file mode 100644 (file)
index 1ef52b3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-server_tokens off;
-
-server {
-       listen 80;
-       server_name nginx;
-       charset utf-8;
-
-       access_log /var/log/nginx/app-access.log;
-       error_log /var/log/nginx/app-error.log;
-
-       # max upload size
-       client_max_body_size 75M; # adjust to taste
-
-       # Django media
-       location /media {
-                       alias /media; # your Django project's media files - amend as required
-                autoindex on;
-       }
-       # Django static
-       location /static {
-               alias /var/www/static; # your Django project's static files - amend as required
-               autoindex on;
-       }
-
-       location / {
-            uwsgi_pass app:8000;
-            include /etc/nginx/uwsgi_params;
-       }
-}
-
index 10db902b5a6fab42837577f5618b4bcfec6bc957..d5c674d82ff80c13381e14397f2006f589d1c6aa 100644 (file)
@@ -2,7 +2,7 @@
 
 # paths
 app_dir='/opt/TimeSide/'
-sandbox_dir=$app_dir'examples/sandbox/'
+sandbox_dir='/home/timeside/'
 manage=$sandbox_dir'manage.py'
 wsgi=$sandbox_dir'wsgi.py'
 app_static_dir=$app_dir'timeside/player/static/'