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

79 lines
1.9 KiB
YAML
Raw Normal View History

version: '2'
2016-04-08 09:31:02 +03:00
volumes:
postgres_data: {}
postgres_backup: {}
services:
postgres:
build: ./compose/postgres
volumes:
2016-04-08 09:31:02 +03:00
- postgres_data:/var/lib/postgresql/data
- postgres_backup:/backups
env_file: .env
2015-07-16 18:43:02 +03:00
django:
build:
context: .
dockerfile: ./compose/django/Dockerfile
2016-03-08 12:12:55 +03:00
depends_on:
- postgres
- redis
command: /gunicorn.sh
env_file: .env
2015-07-16 18:43:02 +03:00
nginx:
build: ./compose/nginx
2016-03-08 12:12:55 +03:00
depends_on:
- django
{% if cookiecutter.use_lets_encrypt == 'y' %}
- certbot
environment:
- MY_DOMAIN_NAME={{ cookiecutter.domain_name }}
{% endif %}
ports:
- "0.0.0.0:80:80"
{% if cookiecutter.use_lets_encrypt == 'y' %}
- "0.0.0.0:443:443"
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/lib/letsencrypt:/var/lib/letsencrypt
certbot:
image: quay.io/letsencrypt/letsencrypt
command: bash -c "sleep 6 && certbot certonly -n --standalone -d {{ cookiecutter.domain_name }} --test --agree-tos --email {{ cookiecutter.email }} --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --keep-until-expiring --preferred-challenges http-01"
entrypoint: ""
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/lib/letsencrypt:/var/lib/letsencrypt
ports:
- "80"
- "443"
environment:
- TERM=xterm
{% endif %}
2015-07-16 18:43:02 +03:00
redis:
image: redis:3.0
{% if cookiecutter.use_celery == 'y' %}
celeryworker:
build:
context: .
dockerfile: ./compose/django/Dockerfile
env_file: .env
2016-03-08 12:12:55 +03:00
depends_on:
- postgres
- redis
command: celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO
2015-07-16 18:43:02 +03:00
celerybeat:
build:
context: .
dockerfile: ./compose/django/Dockerfile
env_file: .env
2016-03-08 12:12:55 +03:00
depends_on:
- postgres
- redis
command: celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO
{% endif %}