Refactored docker-compose roles

This commit is contained in:
2025-07-07 03:24:54 +02:00
parent 2ea7a606b6
commit 38ed1e94e8
102 changed files with 681 additions and 507 deletions

View File

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

View File

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

View File

@@ -1,7 +0,0 @@
{# This template needs to be included in docker-compose.yml containers, which just depend on a database #}
{% if not applications | is_feature_enabled('central_database',application_id) %}
depends_on:
database:
condition: service_healthy
{% endif %}
{{ "\n" }}

View File

@@ -1,19 +1,21 @@
services:
portfolio:
build:
context: {{docker_repository_path}}
dockerfile: Dockerfile
image: application-portfolio
container_name: portfolio
ports:
- 127.0.0.1:{{ports.localhost.http[application_id]}}:5000
{% include 'roles/docker-central-database/templates/services/main.yml.j2' %}
application:
image: "{{ applications[application_id].images[application_id] }}"
volumes:
- {{docker_repository_path}}app:/app
restart: unless-stopped
- uploads:/var/lib/mobilizon/uploads
- {{ mobilizon_host_conf_exs_file }}:/etc/mobilizon/config.exs:ro
ports:
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:{{ container_port }}"
{% 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' %}
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/localhost/5000 && echo -e 'GET / HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && cat <&3 | grep -q 'HTTP/1.1'"]
interval: 30s
timeout: 10s
retries: 3
{% include 'templates/docker/compose/networks.yml.j2' %}
{% include 'templates/docker/compose/volumes.yml.j2' %}
uploads:
{% include 'templates/docker/compose/networks.yml.j2' %}

View File

@@ -1,7 +1,10 @@
credentials:
docker:
images: {}
versions: {}
images: {} # @todo Move under services
versions: {} # @todo Move under services
services:
redis:
enabled: false # Enable Redis
features:
matomo: true # Enable Matomo Tracking
css: true # Enable Global CSS Styling
@@ -16,4 +19,8 @@ csp:
domains:
canonical: [] # Urls under which the domain should be directly accessible
alias: [] # Alias redirections to the first element of the canonical domains
rbac:
roles:
mail-bot:
description: "Has an token to send and recieve emails"