mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 11:34:00 +03:00
03ee6c78d6
Closes #1235.
71 lines
1.4 KiB
YAML
71 lines
1.4 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:
|
|
- ./.envs/.production/.django
|
|
- ./.envs/.production/.postgres
|
|
{%- if cookiecutter.use_celery == 'y' %}
|
|
- ./.envs/.production/.celery
|
|
{%- endif %}
|
|
command: /gunicorn.sh
|
|
|
|
postgres:
|
|
build:
|
|
context: .
|
|
dockerfile: ./compose/production/postgres/Dockerfile
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- postgres_backup:/backups
|
|
env_file:
|
|
- ./.envs/.production/.postgres
|
|
|
|
caddy:
|
|
build:
|
|
context: .
|
|
dockerfile: ./compose/production/caddy/Dockerfile
|
|
depends_on:
|
|
- django
|
|
volumes:
|
|
- caddy:/root/.caddy
|
|
env_file:
|
|
- ./.envs/.production/.caddy
|
|
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
|
|
env_file:
|
|
- ./.envs/.production/.celery
|
|
command: /start-celeryworker.sh
|
|
|
|
celerybeat:
|
|
<<: *django
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
env_file:
|
|
- ./.envs/.production/.celery
|
|
command: /start-celerybeat.sh
|
|
|
|
{%- endif %}
|