handle traefik_install variables, and set default values for each chill configuration

This commit is contained in:
2026-01-20 16:33:32 +01:00
parent f545970f05
commit 64d0a63e68
6 changed files with 105 additions and 62 deletions
+27 -14
View File
@@ -2,42 +2,51 @@
services:
frontend:
image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_nginx_name }}:{{ item.chill_image_tag }}
image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_nginx_name }}:{{ chill.chill_image_tag }}
links:
- app:php
{% if traefik_install %}
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.frontend-{{ item.chill_environment }}.rule=Host(`{{ item.host }}`)"
- "traefik.http.routers.frontend-{{ item.chill_environment }}.entrypoints=websecure"
{%+ if item.tls_config == 'self_signed' +%}
- "traefik.http.routers.frontend-{{ item.chill_environment }}.tls=true"
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.rule=Host(`{{ chill.host }}`)"
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.entrypoints=websecure"
{%+ if chill.tls_config == 'self_signed' +%}
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.tls=true"
{%+ endif +%}
{%+ if item.expose_port is not false +%}
- "traefik.http.routers.frontend-exp-{{ item.chill_environment }}.rule=PathPrefix(`/`)"
- "traefik.http.routers.frontend-exp-{{ item.chill_environment }}.entrypoints=chill{{ item.chill_environment }}"
{%+ if item.tls_config == 'self_signed' +%}
- "traefik.http.routers.frontend-exp-{{ item.chill_environment }}.tls=true"
{%+ if chill.expose_port is not false +%}
- "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.rule=PathPrefix(`/`)"
- "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.entrypoints=chill{{ chill.chill_environment }}"
{%+ if chill.tls_config == 'self_signed' +%}
- "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.tls=true"
{%+ endif +%}
{%+ endif +%}
{% endif %}
networks:
{% if traefik_install %}
- traefik
{% endif %}
- default
restart: always
app: &defaultApp
image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_php_name }}:{{ item.chill_image_tag }}
image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_php_name }}:{{ chill.chill_image_tag }}
env_file:
- env_file.env
volumes:
- './config/prod:/var/www/app/config/packages/prod:ro'
- '/var/log/chill:/var/www/app/var/log:rw'
- '{{ doc_storage_dir }}/{{ item['chill_environment'] }}:/var/storage:rw'
- '{{ doc_storage_dir }}/{{ chill['chill_environment'] }}:/var/storage:rw'
links:
- redis
- relatorio
- rabbitmq
{% if item.add_postgres -%}
{% if chill.add_postgres -%}
- database
{%- endif %}
@@ -71,7 +80,7 @@ services:
command: ["bin/console", "chill:cron-job:execute", "-v"]
restart: "no"
{% if item.add_postgres %}
{% if chill.add_postgres %}
database:
image: "{{ database_image }}"
@@ -137,6 +146,10 @@ services:
restart: always
networks:
{% if traefik_install %}
traefik:
external: true
{% endif %}
default: