Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
qtrinh2 committed Sep 12, 2024
1 parent 68a17e3 commit 0199814
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions django/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ services:
command: >
sh -c "poetry run python manage.py migrate &&
poetry run python manage.py runserver 0.0.0.0:8000"
{% if template.volumes is defined and ((template.volumes | selectattr('service', 'eq', service)) is iterable) %}

{% if template.volumes is defined %}
{% set vols = (template.volumes | selectattr('service', 'eq', service) %}
{% if vols is iterable and vols | length > 0 %}
volumes:
{% for vol in (template.volumes | selectattr('service', 'eq', service)) %}
{% for vol in vols %}

- {{ vol.name }}:{{ vol.container_path }}
{% endfor %}
{% endif %}
{% endif %}

depends_on:
db:
Expand All @@ -51,14 +53,16 @@ services:
- POSTGRES_USER={{ template.env.db_user }}
- POSTGRES_PASSWORD={{ template.env.db_pass }}
- POSTGRES_HOST=db
{% if template.volumes is defined and ((template.volumes | selectattr('service', 'eq', service)) is iterable) %}

{% if template.volumes is defined %}
{% set vols = (template.volumes | selectattr('service', 'eq', service) %}
{% if vols is iterable and vols | length > 0 %}
volumes:
{% for vol in (template.volumes | selectattr('service', 'eq', service)) %}
{% for vol in vols %}

- {{ vol.name }}:{{ vol.container_path }}
{% endfor %}
{% endif %}
{% endif %}

healthcheck:
test: ["CMD-SHELL", "pg_isready -U {{ template.env.db_user }} -d {{ template.env.db_name }}"]
Expand Down

0 comments on commit 0199814

Please sign in to comment.