version: '2' volumes: postgres_data: {} postgres_backup: {} services: postgres: build: ./compose/postgres volumes: - postgres_data:/var/lib/postgresql/data - postgres_backup:/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: . dockerfile: ./compose/django/Dockerfile 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: . dockerfile: ./compose/django/Dockerfile user: django env_file: .env depends_on: - postgres - redis command: celery -A {{cookiecutter.repo_name}}.taskapp beat -l INFO depends_on: - postgres - redis {% endif %}