cookiecutter-django/{{cookiecutter.project_slug}}/production.yml
Shupeyko Nikita 188ff966f8 Re-organize compose/ into environment-specific file groups (#1317)
* Re-organize compose/ into environment-specific file groups

Closes #1316.

* Commit missing files

That was weird: git failed to commit one specific folder previously
2017-09-05 14:39:20 +03:00

58 lines
1.1 KiB
YAML

version: '2'
volumes:
postgres_data: {}
postgres_backup: {}
caddy: {}
services:
django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %}
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
depends_on:
- postgres
- redis
env_file: .env
command: /gunicorn.sh
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backup:/backups
env_file: .env
caddy:
build:
context: .
dockerfile: ./compose/production/caddy/Dockerfile
depends_on:
- django
volumes:
- caddy:/root/.caddy
env_file: .env
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
redis:
image: redis:3.0
{% if cookiecutter.use_celery == 'y' %}
celeryworker:
<<: *django
depends_on:
- postgres
- redis
command: /start-celeryworker.sh
celerybeat:
<<: *django
depends_on:
- postgres
- redis
command: /start-celerybeat.sh
{% endif %}