2024-01-03 11:38:09 +01:00
|
|
|
# This template needs to be included in docker-compose.yml, which depend on a postgres database
|
2025-02-21 05:06:39 +01:00
|
|
|
{% if not applications[application_id].database.central_storage | bool %}
|
2023-12-28 00:28:30 +01:00
|
|
|
database:
|
2025-02-03 11:44:13 +01:00
|
|
|
image: postgres:{{applications.postgres.database_version}}-alpine
|
2025-01-30 15:04:23 +01:00
|
|
|
container_name: {{application_id}}-database
|
2025-02-04 18:14:37 +01:00
|
|
|
env_file:
|
|
|
|
- {{database_env}}
|
2024-01-12 20:57:58 +01:00
|
|
|
restart: {{docker_restart_policy}}
|
2023-12-28 00:28:30 +01:00
|
|
|
healthcheck:
|
2024-01-06 14:32:49 +01:00
|
|
|
test: ["CMD-SHELL", "pg_isready -U {{database_name}}"]
|
2023-12-28 00:28:30 +01:00
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 6
|
|
|
|
volumes:
|
2024-01-02 21:13:34 +01:00
|
|
|
- type: volume
|
2023-12-28 00:28:30 +01:00
|
|
|
source: database
|
|
|
|
target: /var/lib/postgresql/data
|
2024-01-02 21:13:34 +01:00
|
|
|
networks:
|
2024-01-05 20:22:34 +01:00
|
|
|
- default
|
2024-01-04 10:15:46 +01:00
|
|
|
{% endif %}
|
2024-01-04 11:36:55 +01:00
|
|
|
{{ "\n" }}
|