From: Thomas Fillon Date: Thu, 12 Mar 2015 14:04:23 +0000 (+0100) Subject: Docker-compose: change media container to home and move sandbox to /home/timeside X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=25744c2247592da1bee13e2978eb7d2c64539776;p=timeside.git Docker-compose: change media container to home and move sandbox to /home/timeside --- diff --git a/Dockerfile b/Dockerfile index 919c006..bf0bc40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/docker-compose.yml b/docker-compose.yml index 22fc693..5067dfe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 index 0000000..6d495f3 --- /dev/null +++ b/examples/deploy/nginx-app.conf @@ -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 index 1ef52b3..0000000 --- a/examples/deploy/nginx/sites-enabled/app.conf +++ /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; - } -} - diff --git a/examples/deploy/start_app.sh b/examples/deploy/start_app.sh index 10db902..d5c674d 100644 --- a/examples/deploy/start_app.sh +++ b/examples/deploy/start_app.sh @@ -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/'