Skip to content
Permalink
Browse files

Add docker-compose file for production uses and changes in supervisor…

… config file
  • Loading branch information...
sebinthomas authored and cyriac committed Jul 13, 2016
1 parent 4d107b4 commit 2e57738ac78d9f532a27cab8a4d3718c1e2e734e
Showing with 33 additions and 2 deletions.
  1. +2 −1 Dockerfile.prod
  2. +9 −1 deploy/supervisor/supervisord_dev.conf
  3. +22 −0 docker-compose-prod.yml
@@ -13,5 +13,6 @@ COPY deploy/supervisor/supervisord_dev.conf /etc/supervisor/supervisord.conf
RUN mkdir -p $APPLICATION_ROOT
WORKDIR $APPLICATION_ROOT
ADD requirements.txt $APPLICATION_ROOT
RUN pip install -r requirements.txt
ADD requirements-dev.txt $APPLICATION_ROOT
RUN pip install -r requirements-dev.txt
ADD . $APPLICATION_ROOT
@@ -2,11 +2,19 @@
nodaemon = True

[program: stormtrooper]
command = %(ENV_APPLICATION_ROOT)s/stormtrooper/manage.py runserver 0.0.0.0:8000
command = daphne -b 0.0.0.0 -p 8000 stormtrooper.asgi:channel_layer
user = root
stdout_events_enabled = true
stderr_events_enabled = true
redirect_stderr = true
directory = %(ENV_APPLICATION_ROOT)s/stormtrooper/

[program: st_worker]
command = python manage.py runworker -v2
user = root
autorestart = true
redirect_stderr = true
directory = %(ENV_APPLICATION_ROOT)s/stormtrooper/

[eventlistener:stdout]
command = supervisor_stdout
@@ -0,0 +1,22 @@
web:
build:
context: .
dockerfile: Dockerfile.prod
command: bash -c "python /stormtrooper/stormtrooper/manage.py migrate && supervisord"
volumes:
- .:/stormtrooper
ports:
- "8000:8000"
links:
- db
- redis

db:
image: postgres:9.5
environment:
POSTGRES_PASSWORD: postgres

redis:
image: redis:latest
ports:
- "6379"

0 comments on commit 2e57738

Please sign in to comment.
You can’t perform that action at this time.