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: . 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 %}