cookiecutter-django/{{cookiecutter.project_slug}}/production.yml
2017-08-11 11:16:15 +02:00

60 lines
1.1 KiB
YAML

version: '2'
volumes:
postgres_data: {}
postgres_backup: {}
caddy: {}
services:
django:
build:
context: .
dockerfile: ./compose/django/Dockerfile
depends_on:
- postgres
- redis
command: /gunicorn.sh
env_file: .env
postgres:
build: ./compose/postgres
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backup:/backups
env_file: .env
caddy:
build: ./compose/caddy
depends_on:
- django
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
volumes:
- caddy:/root/.caddy
env_file: .env
redis:
image: redis:3.0
{% if cookiecutter.use_celery == 'y' %}
celeryworker:
build:
context: .
dockerfile: ./compose/django/Dockerfile
env_file: .env
depends_on:
- postgres
- redis
command: celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO
celerybeat:
build:
context: .
dockerfile: ./compose/django/Dockerfile
env_file: .env
depends_on:
- postgres
- redis
command: celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO
{% endif %}