Solved other refactoring bugs and optimized docker role template

This commit is contained in:
2025-07-06 19:54:51 +02:00
parent ea9cc07112
commit 5919f49741
10 changed files with 74 additions and 15 deletions

View File

@@ -21,3 +21,8 @@ galaxy_info:
documentation: "https://github.com/kevinveenbirkenbach/cymais/roles/{{application_id}}"
logo:
class: "{{ logo_classes }}"
run_after:
- docker-matomo
- docker-keycloak
- docker-mailu
dependencies: []

View File

@@ -1,6 +1,6 @@
---
{% if database | bool %}
{% if database_type | bool %}
{% raw %}
- name: "include docker-central-database"
@@ -8,13 +8,6 @@
name: docker-central-database
when: run_once_docker_{% endraw %}{{ application_id }}{% raw %} is not defined
- name: "include role nginx-domain-setup for {{application_id}}"
include_role:
name: nginx-domain-setup
vars:
domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}"
when: run_once_docker_{% endraw %}{{ application_id }}{% raw %} is not defined
{% endraw %}
{% else %}
@@ -29,6 +22,15 @@
{% endif %}
{% raw %}
- name: "include role nginx-domain-setup for {{application_id}}"
include_role:
name: nginx-domain-setup
vars:
domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}"
when: run_once_docker_{% endraw %}{{ application_id }}{% raw %} is not defined
- name: run the {% raw %}portfolio{% endraw %} tasks once
set_fact:
run_once_docker_portfolio: true

View File

@@ -0,0 +1,19 @@
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
volumes:
- {{docker_repository_path}}app:/app
restart: unless-stopped
{% 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' %}

View File

@@ -0,0 +1,29 @@
features:
matomo: true
css: true
portfolio_iframe: false
csp:
whitelist:
script-src-elem:
- https://cdn.jsdelivr.net
- https://kit.fontawesome.com
style-src:
- https://cdn.jsdelivr.net
font-src:
- https://ka-f.fontawesome.com
- https://cdn.jsdelivr.net
connect-src:
- https://ka-f.fontawesome.com
frame-src:
- "{{ web_protocol }}://*.{{primary_domain}}"
flags:
style-src:
unsafe-inline: true
script-src:
unsafe-inline: true
script-src-elem:
unsafe-inline: true
domains:
canonical:
- "{{ primary_domain }}"