Distinguish between local and production compose services

Rationale: 
1. building production stack on the same machine with local doesn't lead to conflicts anymore;
2. production and local service images are now clearly distinguished by name.
This commit is contained in:
Nikita P. Shupeyko 2018-04-04 13:38:57 +03:00
parent 2fa5adc2b0
commit ae9dc2e782
2 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,7 @@ services:
build:
context: .
dockerfile: ./compose/local/django/Dockerfile
image: {{ cookiecutter.project_slug }}_local_django
depends_on:
- postgres
{%- if cookiecutter.use_mailhog == 'y' %}
@ -27,6 +28,7 @@ services:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: {{ cookiecutter.project_slug }}_production_postgres
volumes:
- postgres_data_local:/var/lib/postgresql/data
- postgres_backup_local:/backups
@ -47,6 +49,7 @@ services:
celeryworker:
<<: *django
image: {{ cookiecutter.project_slug }}_local_celeryworker
depends_on:
- redis
- postgres
@ -61,6 +64,7 @@ services:
celerybeat:
<<: *django
image: {{ cookiecutter.project_slug }}_local_celerybeat
depends_on:
- redis
- postgres

View File

@ -10,6 +10,7 @@ services:
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: {{ cookiecutter.project_slug }}_production_django
depends_on:
- postgres
- redis
@ -22,6 +23,7 @@ services:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: {{ cookiecutter.project_slug }}_production_postgres
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backup:/backups
@ -32,6 +34,7 @@ services:
build:
context: .
dockerfile: ./compose/production/caddy/Dockerfile
image: {{ cookiecutter.project_slug }}_production_caddy
depends_on:
- django
volumes:
@ -48,6 +51,7 @@ services:
celeryworker:
<<: *django
image: {{ cookiecutter.project_slug }}_production_celeryworker
depends_on:
- postgres
- redis
@ -58,6 +62,7 @@ services:
celerybeat:
<<: *django
image: {{ cookiecutter.project_slug }}_production_celerybeat
depends_on:
- postgres
- redis