Finished docker refactoring

This commit is contained in:
2025-07-07 03:48:19 +02:00
parent 38ed1e94e8
commit ca0602a1c8
58 changed files with 252 additions and 160 deletions

2
templates/README.md Normal file
View File

@@ -0,0 +1,2 @@
# Templates
This folder contains global templates which aren't related to a role

View File

@@ -1,19 +0,0 @@
{# This template needs to be included in docker-compose.yml #}
networks:
{% if applications | is_feature_enabled('central_database',application_id) and database_type is defined %}
central_{{ database_type }}:
external: true
{% endif %}
{% if applications[application_id].get('features', {}).get('ldap', false) and applications.ldap.network.docker | bool %}
central_ldap:
external: true
{% endif %}
default:
{% if application_id in networks.local and networks.local[application_id].subnet is defined %}
driver: bridge
ipam:
driver: default
config:
- subnet: {{networks.local[application_id].subnet}}
{% endif %}
{{ "\n" }}

View File

@@ -1,6 +0,0 @@
{# This needs to be included in docker-compose.yml which just contain a database volume #}
{% if not applications | is_feature_enabled('central_database',application_id) %}
volumes:
database:
{% endif %}
{{ "\n" }}

View File

@@ -1,6 +0,0 @@
{# This template needs to be included in docker-compose.yml which contain a database and additional volumes #}
volumes:
{% if not applications | is_feature_enabled('central_database',application_id) %}
database:
{% endif %}
{{ "\n" }}

View File

@@ -1,10 +0,0 @@
{# This template needs to be included in docker-compose.yml containers #}
networks:
{% if applications | is_feature_enabled('central_database',application_id) | bool and database_type is defined %}
central_{{ database_type }}:
{% endif %}
{% if applications[application_id].get('features', {}).get('ldap', false) | bool and applications.ldap.network.docker|bool %}
central_ldap:
{% endif %}
default:
{{ "\n" }}

View File

@@ -1,17 +0,0 @@
# This template needs to be included in docker-compose.yml, which depend on redis
redis:
image: redis:alpine
container_name: {{application_id}}-redis
restart: {{docker_restart_policy}}
logging:
driver: journald
volumes:
- redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 30
networks:
- default
{{ "\n" }}

View File

@@ -12,10 +12,10 @@ services:
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
{% include 'roles/docker-container/templates/base.yml.j2' %}
{% include 'roles/docker-container/templates/depends_on_dmbs.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
{% include 'templates/docker/compose/volumes.yml.j2' %}
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
uploads:
{% include 'templates/docker/compose/networks.yml.j2' %}
{% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@@ -1,3 +0,0 @@
# Todo
- Implement Keycloak iframe so that mailu can be used in iframe
- Activate mailu in iframe