From d4c62dbf7229f57910ef698c238217d5c8aa0d1d Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 17 Sep 2025 16:26:02 +0200 Subject: [PATCH] docker-container: ensure explicit network alias for DB services Added explicit aliases in the networks configuration for database containers (Postgres/MariaDB). This guarantees that the configured 'database_host' is always resolvable across external networks, fixing intermittent 'UnknownHostException' issues when restarting dependent services (e.g., Confluence). Ref: https://chatgpt.com/share/68cabfac-8618-800f-bcf4-609fdff432ed --- roles/docker-container/templates/networks.yml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/docker-container/templates/networks.yml.j2 b/roles/docker-container/templates/networks.yml.j2 index 4734bc79..d8a5d410 100644 --- a/roles/docker-container/templates/networks.yml.j2 +++ b/roles/docker-container/templates/networks.yml.j2 @@ -5,6 +5,8 @@ application_id in ['svc-db-mariadb','svc-db-postgres'] %} {{ applications | get_app_conf('svc-db-' ~ database_type, 'docker.network') }}: + aliases: + - {{ database_host }} {% endif %} {% if applications | get_app_conf(application_id, 'features.ldap', False) and applications | get_app_conf('svc-db-openldap', 'network.docker') %} {{ applications | get_app_conf('svc-db-openldap', 'docker.network') }}: