21 lines
698 B
Django/Jinja

# This template needs to be included in docker-compose.yml, which depend on a postgres database
{% if not applications | get_app_conf(application_id, 'features.central_database', False) %}
{{ database_host }}:
image: postgres:{{applications['svc-db-postgres'].version}}-alpine
container_name: {{application_id}}-database
env_file:
- {{database_env}}
restart: {{docker_restart_policy}}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U {{database_name}}"]
interval: 10s
timeout: 5s
retries: 6
volumes:
- type: volume
source: database
target: /var/lib/postgresql/data
networks:
- default
{% endif %}
{{ "\n" }}