cookiecutter-django/{{cookiecutter.repo_name}}/docker-compose.yml
2016-03-23 20:45:09 +01:00

60 lines
1.1 KiB
YAML

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