From bf2e38ad51cfdfc3a31b1ebbd2332b471993d9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 20 Dec 2024 13:13:44 +0100 Subject: [PATCH] expose port for chill and add missing variables and parameters --- templates/compose.yaml | 8 ++++++-- templates/env_file.env | 11 ++++++++++- templates/traefik-compose.yaml | 4 ++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/templates/compose.yaml b/templates/compose.yaml index ddd5eb6..68612fc 100644 --- a/templates/compose.yaml +++ b/templates/compose.yaml @@ -6,9 +6,13 @@ services: - app:php labels: - "traefik.enable=true" - - "traefik.http.routers.frontend.rule=Host(`{{ item.host }}`)" - - "traefik.http.routers.frontend.entrypoints=web" + - "traefik.http.routers.frontend-{{ item.chill_environment }}.rule=Host(`{{ item.host }}`)" + - "traefik.http.routers.frontend-{{ item.chill_environment }}.entrypoints=web" - "traefik.docker.network=traefik" + {% if item.expose_port is not false -%} + ports: + - "{{ item.expose_port }}:80" + {% endif -%} networks: - traefik - default diff --git a/templates/env_file.env b/templates/env_file.env index 2f9bb18..a24675c 100644 --- a/templates/env_file.env +++ b/templates/env_file.env @@ -26,10 +26,19 @@ ASYNC_UPLOAD_TEMP_URL_KEY= DEFAULT_CARRIER_CODE=FR APP_SECRET={{ item.chill_config.app_secret }} ADMIN_PASSWORD={{ item.chill_config.admin_password }} +{% if item.chill_config.admin_password_1 is defined -%} +ADMIN_PASSWORD_1={{ item.chill_config.admin_password_1 }} +{% endif -%} +{% if item.chill_config.admin_password_2 is defined -%} +ADMIN_PASSWORD_2={{ item.chill_config.admin_password_2 }} +{% endif -%} +{% if item.chill_config.admin_password_3 is defined -%} +ADMIN_PASSWORD_3={{ item.chill_config.admin_password_3 }} +{% endif -%} MAILER_DSN={{ item.chill_config.mailer_dsn }} MAILER_URL={{ item.chill_config.mailer_url }} JWT_PASSPHRASE={{ item.chill_config.jwt_passphrase }} JWT_SECRET_KEY={{ item.chill_config.jwt_secret_key }} JWT_PUBLIC_KEY={{ item.chill_config.jwt_public_key }} RABBITMQ_URL=amqp://{{ item.chill_config.rabbitmq_user }}:{{ item.chill_config.rabbitmq_password }}@rabbitmq/%2f -DATABASE_URL=postgres://{{ item.chill_config.database_user }}:{{ item.chill_config.database_password }}@{% if item.add_postgres %}database:5432{% else %}{{ item.chill_config.database_host }}{% endif %}/{{ item.chill_config.database_name }}?sslmode=disable&charset=utf8&serverVersion={{ item.chill_config.database_version }} \ No newline at end of file +DATABASE_URL=postgres://{{ item.chill_config.database_user }}:{{ item.chill_config.database_password }}@{% if item.add_postgres %}database:5432{% else %}{{ item.chill_config.database_host }}{% endif %}/{{ item.chill_config.database_name }}?sslmode=disable&charset=utf8&serverVersion={{ item.chill_config.database_version }} diff --git a/templates/traefik-compose.yaml b/templates/traefik-compose.yaml index ecef904..d4cc85a 100644 --- a/templates/traefik-compose.yaml +++ b/templates/traefik-compose.yaml @@ -4,8 +4,12 @@ services: image: traefik:v3.2 # Enables the web UI and tells Traefik to listen to docker command: + {% if traefik_debug|default(False) -%} - "--log.level=debug" + {% endif -%} + {% if traefik_insecure|default(False) -%} - "--api.insecure=true" + {% endif -%} - "--providers.docker=true" - "--providers.docker.exposedByDefault=false" - "--entryPoints.web.address=:80"