General optimations and debugging

This commit is contained in:
2025-07-08 13:50:23 +02:00
parent cb29a479b3
commit 36ff93e64e
69 changed files with 425 additions and 290 deletions

View File

@@ -17,7 +17,7 @@ The following templates are available under `roles/docker-container/templates/`:
- `central_ldap` when LDAP feature and network are enabled
- `default`
- **depends_on_dmbs.j2**
- **depends_on_dmbs.yml.j2**
Builds a `depends_on:` block automatically:
- If `central_database` is **off**, renders an empty list `depends_on: []`
- Otherwise, includes `database` and/or `redis` with healthcheck conditions

View File

@@ -0,0 +1,8 @@
{% if not applications | is_feature_enabled('central_database',application_id) %}
{{ database_host }}:
condition: service_healthy
{% endif %}
{% if applications[application_id].docker.services.redis.enabled | default(false) | bool %}
redis:
condition: service_healthy
{% endif %}

View File

@@ -0,0 +1,9 @@
{# This template needs to be included in docker-compose.yml containers, which depend on a database, redis and optional additional volumes #}
{% if
(applications[application_id].docker.services.redis.enabled | default(false)| bool) or
not applications | is_feature_enabled('central_database',application_id)
%}
depends_on:
{% include "roles/docker-container/templates/depends_on/dbms_base.yml.j2" %}
{% endif %}
{{ "\n" }}

View File

@@ -0,0 +1,4 @@
{# This template needs to be included in docker-compose.yml containers, which depend on a database, redis and optional additional volumes #}
depends_on:
{% include "roles/docker-container/templates/depends_on/dbms_base.yml.j2" %}
{{ "\n" }}

View File

@@ -1,18 +0,0 @@
{# This template needs to be included in docker-compose.yml containers, which depend on a database, redis and optional additional volumes #}
{% if applications | is_feature_enabled('central_database', application_id)
and not (applications[application_id].docker.services.redis.enabled
| default(false)
| bool) %}
depends_on: []
{% else %}
depends_on:
{% if not applications | is_feature_enabled('central_database', application_id) %}
database:
condition: service_healthy
{% endif %}
{% if applications[application_id].docker.services.redis.enabled | default(false) | bool %}
redis:
condition: service_healthy
{% endif %}
{% endif %}
{{ "\n" }}