cookiecutter-django/{{cookiecutter.project_slug}}/production.yml

71 lines
1.4 KiB
YAML
Raw Normal View History

version: '2'
2016-04-08 09:31:02 +03:00
volumes:
postgres_data: {}
postgres_backup: {}
2017-08-11 12:16:15 +03:00
caddy: {}
2016-04-08 09:31:02 +03:00
services:
django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %}
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
2016-03-08 12:12:55 +03:00
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
{%- if cookiecutter.use_celery == 'y' %}
- ./.envs/.production/.celery
{%- endif %}
command: /gunicorn.sh
2015-07-16 18:43:02 +03:00
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backup:/backups
env_file:
- ./.envs/.production/.postgres
2017-08-11 12:16:15 +03:00
caddy:
build:
context: .
dockerfile: ./compose/production/caddy/Dockerfile
2016-03-08 12:12:55 +03:00
depends_on:
- django
volumes:
2017-08-11 12:16:15 +03:00
- caddy:/root/.caddy
env_file:
- ./.envs/.production/.caddy
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
2015-07-16 18:43:02 +03:00
redis:
image: redis:3.0
{%- if cookiecutter.use_celery == 'y' %}
celeryworker:
<<: *django
2016-03-08 12:12:55 +03:00
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.celery
command: /start-celeryworker.sh
2015-07-16 18:43:02 +03:00
celerybeat:
<<: *django
2016-03-08 12:12:55 +03:00
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.celery
command: /start-celerybeat.sh
{%- endif %}