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

63 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
image: {{ cookiecutter.project_slug }}_production_django
2016-03-08 12:12:55 +03:00
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
2018-05-21 22:28:18 +03:00
command: /start
2015-07-16 18:43:02 +03:00
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: {{ cookiecutter.project_slug }}_production_postgres
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
image: {{ cookiecutter.project_slug }}_production_caddy
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:
2018-05-05 01:30:57 +03:00
image: redis:3.2
{%- if cookiecutter.use_celery == 'y' %}
celeryworker:
<<: *django
image: {{ cookiecutter.project_slug }}_production_celeryworker
2018-05-14 10:28:50 +03:00
command: /start-celeryworker
2015-07-16 18:43:02 +03:00
celerybeat:
<<: *django
image: {{ cookiecutter.project_slug }}_production_celerybeat
2018-05-14 10:28:50 +03:00
command: /start-celerybeat
{%- endif %}