Skip to content

Commit

Permalink
volumes stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
qtrinh2 committed Sep 12, 2024
1 parent 3636c61 commit f8743e4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions django/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ services:
- POSTGRES_PASSWORD={{ template.env.db_pass }}
- POSTGRES_HOST=db
volumes:
- pg-data:/var/lib/postgresql/data/
- {{ template.volumes | selectattr('container_path', 'eq', '/var/lib/postgresql/data/') | first }}:/var/lib/postgresql/data/
healthcheck:
test: ["CMD-SHELL", "pg_isready -U {{ template.env.db_user }} -d {{ template.env.db_name }}"]
interval: 2s
timeout: 5s
retries: 3

volumes:
pg-data:
name: "{{ compose_stack_name }}--db"
{% for vol in template.volumes %}

{{ vol.name }}:
name: "{{ compose_stack_name }}--{{ vol.id }}"
external: true
{% endfor %}

0 comments on commit f8743e4

Please sign in to comment.