From 54d4eeb1abf304beb35536496d999796cd1ae6fa Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 17 Sep 2025 18:42:36 +0200 Subject: [PATCH] Fix network alias assignment for DB services Ensure that the database host alias is only attached to the database containers themselves, not to dependent application containers. This avoids DNS collisions where multiple containers expose the same alias (e.g. 'postgres') on the same network, which led to connection refused errors in XWiki. See conversation: https://chatgpt.com/share/68cae4e5-94e4-800f-b291-d2acdb36af21 --- 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 d8a5d410..2237f051 100644 --- a/roles/docker-container/templates/networks.yml.j2 +++ b/roles/docker-container/templates/networks.yml.j2 @@ -5,9 +5,11 @@ application_id in ['svc-db-mariadb','svc-db-postgres'] %} {{ applications | get_app_conf('svc-db-' ~ database_type, 'docker.network') }}: +{% if application_id in ['svc-db-mariadb','svc-db-postgres'] %} aliases: - {{ database_host }} {% endif %} +{% 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') }}: {% endif %}