mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-18 00:06:05 +02:00
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
19 lines
816 B
Django/Jinja
19 lines
816 B
Django/Jinja
{# This template needs to be included in docker-compose.yml containers #}
|
|
networks:
|
|
{% if
|
|
(applications | get_app_conf(application_id, 'features.central_database', False) and database_type is defined) or
|
|
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 %}
|
|
{% if application_id != 'svc-db-openldap' %}
|
|
default:
|
|
{% endif %}
|
|
{{ "\n" }} |