2016-03-03 07:16:25 +03:00
|
|
|
version: '2'
|
2016-04-08 09:31:02 +03:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
postgres_data: {}
|
|
|
|
postgres_backup: {}
|
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
services:
|
|
|
|
postgres:
|
2016-03-08 12:48:31 +03:00
|
|
|
build: ./compose/postgres
|
2016-03-03 07:16:25 +03:00
|
|
|
volumes:
|
2016-04-08 09:31:02 +03:00
|
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
- postgres_backup:/backups
|
2016-03-03 07:16:25 +03:00
|
|
|
env_file: .env
|
2015-07-16 18:43:02 +03:00
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
django:
|
|
|
|
build:
|
|
|
|
context: .
|
2016-03-23 22:45:09 +03:00
|
|
|
dockerfile: ./compose/django/Dockerfile
|
2016-03-08 12:12:55 +03:00
|
|
|
depends_on:
|
2016-03-03 07:16:25 +03:00
|
|
|
- postgres
|
|
|
|
- redis
|
|
|
|
command: /gunicorn.sh
|
|
|
|
env_file: .env
|
2015-07-16 18:43:02 +03:00
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
nginx:
|
|
|
|
build: ./compose/nginx
|
2016-03-08 12:12:55 +03:00
|
|
|
depends_on:
|
2016-03-03 07:16:25 +03:00
|
|
|
- django
|
2016-06-05 23:17:19 +03:00
|
|
|
{% if cookiecutter.use_lets_encrypt == 'y' %}
|
2016-06-03 18:07:39 +03:00
|
|
|
- certbot
|
|
|
|
environment:
|
|
|
|
- MY_DOMAIN_NAME={{ cookiecutter.domain_name }}
|
2017-05-12 19:23:22 +03:00
|
|
|
{% endif %}
|
2016-06-03 18:07:39 +03:00
|
|
|
ports:
|
|
|
|
- "0.0.0.0:80:80"
|
2017-05-12 19:23:22 +03:00
|
|
|
{% if cookiecutter.use_lets_encrypt == 'y' %}
|
2016-06-03 18:07:39 +03:00
|
|
|
- "0.0.0.0:443:443"
|
|
|
|
volumes:
|
|
|
|
- /etc/letsencrypt:/etc/letsencrypt
|
|
|
|
- /var/lib/letsencrypt:/var/lib/letsencrypt
|
|
|
|
|
|
|
|
certbot:
|
|
|
|
image: quay.io/letsencrypt/letsencrypt
|
2017-06-02 22:47:53 +03:00
|
|
|
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"
|
2016-06-03 18:07:39 +03:00
|
|
|
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
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
redis:
|
2017-04-21 20:44:06 +03:00
|
|
|
image: redis:3.0
|
2016-06-03 18:07:39 +03:00
|
|
|
{% if cookiecutter.use_celery == 'y' %}
|
2016-03-03 07:16:25 +03:00
|
|
|
celeryworker:
|
|
|
|
build:
|
|
|
|
context: .
|
2016-04-12 16:36:13 +03:00
|
|
|
dockerfile: ./compose/django/Dockerfile
|
2016-03-03 07:16:25 +03:00
|
|
|
env_file: .env
|
2016-03-08 12:12:55 +03:00
|
|
|
depends_on:
|
2016-03-03 07:16:25 +03:00
|
|
|
- postgres
|
|
|
|
- redis
|
2016-04-20 20:00:35 +03:00
|
|
|
command: celery -A {{cookiecutter.project_slug}}.taskapp worker -l INFO
|
2015-07-16 18:43:02 +03:00
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
celerybeat:
|
|
|
|
build:
|
|
|
|
context: .
|
2016-04-12 16:36:13 +03:00
|
|
|
dockerfile: ./compose/django/Dockerfile
|
2016-03-03 07:16:25 +03:00
|
|
|
env_file: .env
|
2016-03-08 12:12:55 +03:00
|
|
|
depends_on:
|
2016-03-03 07:16:25 +03:00
|
|
|
- postgres
|
|
|
|
- redis
|
2016-04-20 20:00:35 +03:00
|
|
|
command: celery -A {{cookiecutter.project_slug}}.taskapp beat -l INFO
|
2016-06-03 18:07:39 +03:00
|
|
|
{% endif %}
|