mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-02-22 20:39:40 +01:00
21 lines
667 B
Django/Jinja
21 lines
667 B
Django/Jinja
# This template needs to be included in docker-compose.yml, which depend on a postgres database
|
|
{% if not applications[application_id].database.central_storage | bool %}
|
|
database:
|
|
image: postgres:{{applications.postgres.database_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" }} |