Switch local service extension tactics

This commit is contained in:
Nikita P. Shupeyko 2017-07-30 16:30:46 +03:00
parent 34f97821a4
commit 813fa60e88

View File

@ -5,7 +5,7 @@ volumes:
postgres_backup_dev: {} postgres_backup_dev: {}
services: services:
django: django: &django
build: build:
context: . context: .
dockerfile: ./compose/django/Dockerfile-dev dockerfile: ./compose/django/Dockerfile-dev
@ -28,7 +28,6 @@ services:
- postgres_backup_dev:/backups - postgres_backup_dev:/backups
environment: environment:
- POSTGRES_USER={{cookiecutter.project_slug}} - POSTGRES_USER={{cookiecutter.project_slug}}
{% if cookiecutter.use_pycharm == 'y' %} {% if cookiecutter.use_pycharm == 'y' %}
pycharm: pycharm:
build: build:
@ -41,21 +40,19 @@ services:
volumes: volumes:
- .:/app - .:/app
{% endif %} {% endif %}
{% if cookiecutter.use_mailhog == 'y' %} {% if cookiecutter.use_mailhog == 'y' %}
mailhog: mailhog:
image: mailhog/mailhog:v1.0.0 image: mailhog/mailhog:v1.0.0
ports: ports:
- "8025:8025" - "8025:8025"
{% endif %} {% endif %}
{% if cookiecutter.use_celery == 'y' %}
{% if cookiecutter.use_celery == 'y' -%}
redis: redis:
image: redis:3.0 image: redis:3.0
celeryworker: celeryworker:
extends: # https://github.com/docker/compose/issues/3220
service: django <<: *django
depends_on: depends_on:
- redis - redis
- postgres{% if cookiecutter.use_mailhog == 'y' %} - postgres{% if cookiecutter.use_mailhog == 'y' %}
@ -63,11 +60,11 @@ services:
command: /start-celeryworker-dev.sh command: /start-celeryworker-dev.sh
celerybeat: celerybeat:
extends: # https://github.com/docker/compose/issues/3220
service: django <<: *django
depends_on: depends_on:
- redis - redis
- postgres{% if cookiecutter.use_mailhog == 'y' %} - postgres{% if cookiecutter.use_mailhog == 'y' %}
- mailhog{% endif %} - mailhog{% endif %}
command: /start-celerybeat-dev.sh command: /start-celerybeat-dev.sh
{%- endif %} {% endif %}