2018-06-27 19:45:36 +03:00
|
|
|
version: '3'
|
2016-04-08 09:31:02 +03:00
|
|
|
|
|
|
|
volumes:
|
2018-06-27 19:52:06 +03:00
|
|
|
production_postgres_data: {}
|
|
|
|
production_postgres_data_backups: {}
|
2019-03-19 12:32:45 +03:00
|
|
|
production_traefik: {}
|
2023-03-04 21:36:11 +03:00
|
|
|
{%- if cookiecutter.cloud_provider == 'None' %}
|
|
|
|
production_django_media: {}
|
|
|
|
{%- endif %}
|
2016-04-08 09:31:02 +03:00
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
services:
|
2017-09-05 14:39:20 +03:00
|
|
|
django:{% if cookiecutter.use_celery == 'y' %} &django{% endif %}
|
2016-03-03 07:16:25 +03:00
|
|
|
build:
|
|
|
|
context: .
|
2017-09-05 14:39:20 +03:00
|
|
|
dockerfile: ./compose/production/django/Dockerfile
|
2023-01-29 15:12:12 +03:00
|
|
|
{%- if cookiecutter.frontend_pipeline == 'Webpack' and cookiecutter.use_whitenoise == 'n' %}
|
|
|
|
args:
|
|
|
|
# These variable can be defined in an .env file in the root of the repo
|
|
|
|
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
|
|
|
DJANGO_AWS_STORAGE_BUCKET_NAME: ${DJANGO_AWS_STORAGE_BUCKET_NAME}
|
|
|
|
DJANGO_AWS_S3_CUSTOM_DOMAIN: ${DJANGO_AWS_S3_CUSTOM_DOMAIN}
|
|
|
|
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
|
|
|
DJANGO_GCP_STORAGE_BUCKET_NAME: ${DJANGO_GCP_STORAGE_BUCKET_NAME}
|
|
|
|
{%- elif cookiecutter.cloud_provider == 'Azure' %}
|
|
|
|
DJANGO_AZURE_ACCOUNT_NAME: ${DJANGO_AZURE_ACCOUNT_NAME}
|
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|
|
|
|
|
2018-04-04 13:38:57 +03:00
|
|
|
image: {{ cookiecutter.project_slug }}_production_django
|
2023-03-04 21:36:11 +03:00
|
|
|
{%- if cookiecutter.cloud_provider == 'None' %}
|
|
|
|
volumes:
|
|
|
|
- production_django_media:/app/{{ cookiecutter.project_slug }}/media
|
|
|
|
{%- endif %}
|
2016-03-08 12:12:55 +03:00
|
|
|
depends_on:
|
2016-03-03 07:16:25 +03:00
|
|
|
- postgres
|
|
|
|
- redis
|
2018-03-08 15:56:15 +03:00
|
|
|
env_file:
|
|
|
|
- ./.envs/.production/.django
|
|
|
|
- ./.envs/.production/.postgres
|
2018-05-21 22:28:18 +03:00
|
|
|
command: /start
|
2015-07-16 18:43:02 +03:00
|
|
|
|
2017-08-11 10:13:30 +03:00
|
|
|
postgres:
|
2017-09-05 14:39:20 +03:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: ./compose/production/postgres/Dockerfile
|
2018-04-04 13:38:57 +03:00
|
|
|
image: {{ cookiecutter.project_slug }}_production_postgres
|
2017-08-11 10:13:30 +03:00
|
|
|
volumes:
|
2022-12-10 01:04:12 +03:00
|
|
|
- production_postgres_data:/var/lib/postgresql/data
|
|
|
|
- production_postgres_data_backups:/backups
|
2018-03-08 15:56:15 +03:00
|
|
|
env_file:
|
|
|
|
- ./.envs/.production/.postgres
|
2017-08-11 10:13:30 +03:00
|
|
|
|
2019-03-19 12:32:45 +03:00
|
|
|
traefik:
|
2017-09-05 14:39:20 +03:00
|
|
|
build:
|
|
|
|
context: .
|
2019-03-19 12:32:45 +03:00
|
|
|
dockerfile: ./compose/production/traefik/Dockerfile
|
|
|
|
image: {{ cookiecutter.project_slug }}_production_traefik
|
2016-03-08 12:12:55 +03:00
|
|
|
depends_on:
|
2016-03-03 07:16:25 +03:00
|
|
|
- django
|
2016-06-03 18:07:39 +03:00
|
|
|
volumes:
|
2022-12-10 01:04:12 +03:00
|
|
|
- production_traefik:/etc/traefik/acme
|
2017-09-05 14:39:20 +03:00
|
|
|
ports:
|
2023-04-15 14:15:15 +03:00
|
|
|
- '0.0.0.0:80:80'
|
|
|
|
- '0.0.0.0:443:443'
|
2020-02-22 22:29:40 +03:00
|
|
|
{%- if cookiecutter.use_celery == 'y' %}
|
2023-04-15 14:15:15 +03:00
|
|
|
- '0.0.0.0:5555:5555'
|
2020-02-22 22:29:40 +03:00
|
|
|
{%- endif %}
|
2015-07-16 18:43:02 +03:00
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
redis:
|
2021-08-12 23:28:21 +03:00
|
|
|
image: redis:6
|
2018-03-08 18:10:38 +03:00
|
|
|
{%- if cookiecutter.use_celery == 'y' %}
|
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
celeryworker:
|
2017-09-05 14:39:20 +03:00
|
|
|
<<: *django
|
2018-04-04 13:38:57 +03:00
|
|
|
image: {{ cookiecutter.project_slug }}_production_celeryworker
|
2018-05-14 10:28:50 +03:00
|
|
|
command: /start-celeryworker
|
2015-07-16 18:43:02 +03:00
|
|
|
|
2016-03-03 07:16:25 +03:00
|
|
|
celerybeat:
|
2017-09-05 14:39:20 +03:00
|
|
|
<<: *django
|
2018-04-04 13:38:57 +03:00
|
|
|
image: {{ cookiecutter.project_slug }}_production_celerybeat
|
2018-05-14 10:28:50 +03:00
|
|
|
command: /start-celerybeat
|
2018-03-08 18:10:38 +03:00
|
|
|
|
2018-06-27 19:33:21 +03:00
|
|
|
flower:
|
|
|
|
<<: *django
|
|
|
|
image: {{ cookiecutter.project_slug }}_production_flower
|
|
|
|
command: /start-flower
|
2018-03-08 18:10:38 +03:00
|
|
|
{%- endif %}
|
2021-03-03 01:50:28 +03:00
|
|
|
{%- if cookiecutter.cloud_provider == 'AWS' %}
|
2019-10-21 10:59:37 +03:00
|
|
|
|
2018-11-08 13:14:58 +03:00
|
|
|
awscli:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: ./compose/production/aws/Dockerfile
|
|
|
|
env_file:
|
|
|
|
- ./.envs/.production/.django
|
|
|
|
volumes:
|
2020-09-07 15:51:52 +03:00
|
|
|
- production_postgres_data_backups:/backups:z
|
2019-10-21 10:59:37 +03:00
|
|
|
{%- endif %}
|
2023-03-04 21:36:11 +03:00
|
|
|
{%- if cookiecutter.cloud_provider == 'None' %}
|
2023-04-16 22:45:52 +03:00
|
|
|
|
2023-03-04 21:36:11 +03:00
|
|
|
nginx:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: ./compose/production/nginx/Dockerfile
|
|
|
|
image: {{ cookiecutter.project_slug }}_local_nginx
|
|
|
|
depends_on:
|
|
|
|
- django
|
|
|
|
volumes:
|
|
|
|
- production_django_media:/usr/share/nginx/media:ro
|
|
|
|
{%- endif %}
|