Compare commits

..
Author SHA1 Message Date
julienfastreandClaude Sonnet 5.5 e3b8d2a5b3 Remove one-off containers after sending short messages
`docker compose run` creates a new container on each execution, which
accumulated (`<env>-cron-run-<id>`). Use `--rm` to remove it at the end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VnXP3D1srf5k8MrtPFUz93
2026-11-20 16:59:31 +01:00
julienfastreandClaude Sonnet 5.5 2dabbc0503 Fix indentation of rendered framework.yaml and messenger.yaml
Jinja control tags are now at column 0 without whitespace modifiers, so
no stray spaces are added before the following line (invalid YAML for
trusted_headers when traefik_install is true).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VnXP3D1srf5k8MrtPFUz93
2026-11-20 16:07:14 +01:00
julienfastreandClaude Sonnet 5.5 1dc092f87f Fix indentation of rendered compose.yaml
Jinja control tags are now at column 0 without whitespace modifiers: with
trim_blocks, the whole tag line disappears and no stray spaces are added
before the following line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VnXP3D1srf5k8MrtPFUz93
2026-11-20 15:55:22 +01:00
julienfastreandClaude Sonnet 5.5 c699983b80 Add optional mount of template overrides and use chill in env templates
- add `load_template_override` (default false) to `default_chill`: controls
  the creation and the mount of the `templates` directory
- use `chill.chill_config` instead of `item.chill_config` in env_file.env,
  rabbitmq.env and postgres.env

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VnXP3D1srf5k8MrtPFUz93
2026-11-18 15:25:34 +01:00
julienfastre 7e0847d1c5 Merge remote-tracking branch 'origin/main' into adaptation-202601 2026-11-18 15:06:13 +01:00
julienfastre bc8caf530b Configure Docker Compose logging with json-file driver
Added logging configuration to all services in `compose.yaml` with json-file driver. Set max-size to 50m for `app` service and 10m for `nginx`, `postgres`, `relatorio`, and `gotenberg` services, with max-file of 3 for log rotation.
2026-11-18 13:36:12 +01:00
julienfastre 2c57e104eb Update monolog configuration with parameterized log prefix and additional handlers
Replaced hardcoded 'test' log prefix with `{{ chill.chill_environment }}` variable. Added `errors_log` handler for error-level logging and `deprecation_log` handler to suppress deprecation warnings. Updated channel exclusions and console handler level for improved log management.
2026-11-18 13:11:04 +01:00
juminet e2ee54f616 Increase the php memory limit from 2G to 3G for the messenger:consume command, for exports 2026-09-29 11:10:32 +02:00
julienfastre 2278378e30 Make default_carrier_code configurable in Chill defaults and update env_file.env template to use dynamic variable 2026-09-15 15:16:57 +02:00
LenaertsJ 405a9b98dc Remove an admin account
One admin account was removed from chill app upon request of vendee
2026-09-14 14:41:50 +00:00
juminet d1bd62529d add a volume mounted for the app container, for the templates (eg, the sms template) 2026-09-07 16:35:59 +02:00
LenaertsJ 72e6352b71 Add admin_pwd 5 and 6 to env_file in correspondance with chill_app 2026-08-25 11:37:27 +00:00
LenaertsJ 95f8bd6e95 Add admin_pwd 4 to env_file in correspondance with chill_app 2026-06-08 09:01:35 +00:00
julienfastre 32a6a31094 Update directory permissions in Chill role to 0777 for data storage 2026-06-05 13:15:19 +02:00
julienfastre 0dcd51b601 adapt role: the image should not be run as root, but with user with id 82. 2026-05-15 15:15:24 +02:00
julienfastre 8ccb88503a Update messenger consumer shell command for preserved environment variables
Replaced `su` with `su -p` in `compose.yaml` to ensure the environment variables of the parent shell are preserved when running the messenger consumer.
2026-04-18 01:00:36 +02:00
julienfastre 3f99ea7fcd Add support for supplementary environment values in Chill configuration
Introduced `supplementary_environment_values` in Chill defaults and updated `env_file.env` template to dynamically inject custom environment variables. Added placeholder `docker_secrets` for future secrets management.
2026-03-13 12:58:11 +01:00
11 changed files with 100 additions and 67 deletions

No files matched your search

+8 -1
View File
@@ -13,6 +13,8 @@ traefik_image_traefik: "traefik:v3.2"
# to install or not traefik as front-end # to install or not traefik as front-end
traefik_install: true traefik_install: true
docker_secrets: []
# default chill config for each environment # default chill config for each environment
default_chill: default_chill:
chill_environment: main_env chill_environment: main_env
@@ -23,12 +25,16 @@ default_chill:
expose_port: false # can be false, or the port number expose_port: false # can be false, or the port number
# use rabbitmq as message broker. If not in use, it will be replaced by doctrine # use rabbitmq as message broker. If not in use, it will be replaced by doctrine
rabbitmq_install: true rabbitmq_install: true
# mount the directory 'templates' (twig overrides) into the app containers. false = do not mount
load_template_override: false
proxy_ips: proxy_ips:
# 127.0.0.1 is always added # 127.0.0.1 is always added
- 192.168.0.0/16 - 192.168.0.0/16
- 10.0.0.0/8 - 10.0.0.0/8
- 172.16.0.0/12 - 172.16.0.0/12
chill_config: chill_config:
# supplementary environment values to set in the in the env file
supplementary_environment_values: {}
trusted_hosts: 'devpms.samusocial.be ' trusted_hosts: 'devpms.samusocial.be '
database_host: '172.17.17.71' database_host: '172.17.17.71'
database_port: '5432' database_port: '5432'
@@ -50,5 +56,6 @@ default_chill:
# jwt_public_key: '1234' # jwt_public_key: '1234'
rabbitmq_user: 'chilldev' rabbitmq_user: 'chilldev'
# rabbitmq_password: # rabbitmq_password:
editor_server: 'https://collabora.samusocial.be' editor_server: 'https://collabora.champs-libres.be'
ovhcloud_dsn: 'null://null' ovhcloud_dsn: 'null://null'
default_carrier_code: 'FR'
+12 -6
View File
@@ -42,15 +42,23 @@
ansible.builtin.file: ansible.builtin.file:
path: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod" path: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod"
state: directory state: directory
owner: "82"
mode: '0500'
- name: Create directory for template overrides (mounted in the app container)
ansible.builtin.file:
path: "{{ install_dir }}/{{ chill['chill_environment'] }}/templates"
state: directory
mode: '0755'
owner: "{{ as_user }}" owner: "{{ as_user }}"
mode: '0400' when: chill.load_template_override
- name: Copy configuration files - name: Copy configuration files
ansible.builtin.template: ansible.builtin.template:
src: "config/prod/{{ file }}" src: "config/prod/{{ file }}"
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod/{{ file }}" dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod/{{ file }}"
owner: "{{ as_user }}" owner: "82"
mode: '0444' mode: '0400'
loop: loop:
- lexik_jwt_authentication.yaml - lexik_jwt_authentication.yaml
- messenger.yaml - messenger.yaml
@@ -63,9 +71,7 @@
- name: Create directory for storing data - name: Create directory for storing data
ansible.builtin.file: ansible.builtin.file:
path: "{{ doc_storage_dir }}/{{ chill['chill_environment'] }}" path: "{{ doc_storage_dir }}/{{ chill['chill_environment'] }}"
owner: "82" mode: '0777'
group: "82"
mode: '0766'
state: directory state: directory
# racing condition: on first execution, this is not available... # racing condition: on first execution, this is not available...
+51 -31
View File
@@ -5,38 +5,40 @@ services:
image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_nginx_name }}:{{ chill.chill_image_tag }} image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_nginx_name }}:{{ chill.chill_image_tag }}
links: links:
- app:php - app:php
{% if traefik_install %}
{% if traefik_install %}
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.docker.network=traefik" - "traefik.docker.network=traefik"
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.rule=Host(`{{ chill.host }}`)" - "traefik.http.routers.frontend-{{ chill.chill_environment }}.rule=Host(`{{ chill.host }}`)"
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.entrypoints=websecure" - "traefik.http.routers.frontend-{{ chill.chill_environment }}.entrypoints=websecure"
{%+ if chill.tls_config == 'self_signed' +%} {% if chill.tls_config == 'self_signed' %}
- "traefik.http.routers.frontend-{{ chill.chill_environment }}.tls=true" - "traefik.http.routers.frontend-{{ chill.chill_environment }}.tls=true"
{%+ endif +%} {% endif %}
{%+ if chill.expose_port is not false +%} {% 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 }}.rule=PathPrefix(`/`)"
- "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.entrypoints=chill{{ chill.chill_environment }}" - "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.entrypoints=chill{{ chill.chill_environment }}"
{%+ if chill.tls_config == 'self_signed' +%} {% if chill.tls_config == 'self_signed' %}
- "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.tls=true" - "traefik.http.routers.frontend-exp-{{ chill.chill_environment }}.tls=true"
{%+ endif +%} {% endif %}
{%+ endif +%} {% endif %}
{% endif %} {% endif %}
{% if chill.expose_port is not false %}
{% if chill.expose_port is not false +%}
ports: ports:
- "{{ chill.expose_port }}:80" - "{{ chill.expose_port }}:80"
{%+ endif %} {% endif %}
networks: networks:
{% if traefik_install %}
{% if traefik_install %}
- traefik - traefik
{% endif %} {% endif %}
- default - default
restart: always restart: always
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
app: &defaultApp app: &defaultApp
image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_php_name }}:{{ chill.chill_image_tag }} image: {{ registry_url }}/{{ registry_project }}/{{ chill_image_php_name }}:{{ chill.chill_image_tag }}
@@ -45,21 +47,28 @@ services:
volumes: volumes:
- './config/prod:/var/www/app/config/packages/prod:ro' - './config/prod:/var/www/app/config/packages/prod:ro'
- '/var/log/chill:/var/www/app/var/log:rw' - '/var/log/chill:/var/www/app/var/log:rw'
{% if chill.load_template_override %}
- './templates:/var/www/app/templates:ro'
{% endif %}
- '{{ doc_storage_dir }}/{{ chill['chill_environment'] }}:/var/storage:rw' - '{{ doc_storage_dir }}/{{ chill['chill_environment'] }}:/var/storage:rw'
links: links:
- redis - redis
- relatorio - relatorio
{% if chill.rabbitmq_install +%} {% if chill.rabbitmq_install %}
- rabbitmq - rabbitmq
{%+ endif %} {% endif %}
{% if chill.add_postgres %}
{% if chill.add_postgres -%}
- database - database
{%- endif %} {% endif %}
networks: networks:
- default - default
restart: always restart: always
logging:
driver: json-file
options:
max-size: "50m"
max-file: "3"
consumer: consumer:
<<: *defaultApp <<: *defaultApp
@@ -73,7 +82,7 @@ services:
sleep 3 && bin/console cache:clear && sleep 3 && bin/console cache:clear &&
while ! [ -f /tmp/kill_me ]; while ! [ -f /tmp/kill_me ];
do do
su -s /bin/bash -c 'php -d memory_limit=2G bin/console messenger:consume priority async --limit=20 --time-limit=600 -v' "www-data"; php -d memory_limit=3G bin/console messenger:consume priority async --limit=40 --time-limit=600 -v;
done; done;
pre_stop: pre_stop:
- command: - command:
@@ -86,8 +95,7 @@ services:
entrypoint: "/usr/bin/env" entrypoint: "/usr/bin/env"
command: ["bin/console", "chill:cron-job:execute", "-v"] command: ["bin/console", "chill:cron-job:execute", "-v"]
restart: "no" restart: "no"
{% if chill.add_postgres %}
{% if chill.add_postgres %}
database: database:
image: "{{ database_image }}" image: "{{ database_image }}"
@@ -98,8 +106,7 @@ services:
networks: networks:
- default - default
restart: always restart: always
{% endif %}
{% endif %}
###> chill-project/chill-bundles ### ###> chill-project/chill-bundles ###
redis: redis:
@@ -107,12 +114,22 @@ services:
networks: networks:
- default - default
restart: always restart: always
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
relatorio: relatorio:
image: "{{ chill_image_relatorio }}" image: "{{ chill_image_relatorio }}"
networks: networks:
- default - default
restart: always restart: always
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
###< chill-project/chill-bundles ### ###< chill-project/chill-bundles ###
# sign-worker: # sign-worker:
@@ -138,8 +155,7 @@ services:
# depends_on: # depends_on:
# rabbitmq: # rabbitmq:
# condition: service_healthy # condition: service_healthy
{% if chill.rabbitmq_install %}
{% if chill.rabbitmq_install +%}
rabbitmq: rabbitmq:
image: "{{ chill_image_rabbitmq }}" image: "{{ chill_image_rabbitmq }}"
env_file: env_file:
@@ -152,13 +168,17 @@ services:
networks: networks:
- default - default
restart: always restart: always
{% endif %} logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
{% endif %}
networks: networks:
{% if traefik_install %}
{% if traefik_install %}
traefik: traefik:
external: true external: true
{% endif %} {% endif %}
default: default:
+3 -3
View File
@@ -1,11 +1,11 @@
# this file is managed by ansible. Do not edit it by hand # this file is managed by ansible. Do not edit it by hand
framework: framework:
{% if traefik_install +%} {% if traefik_install %}
trusted_proxies: '127.0.0.1,REMOTE_ADDR{% for ip in traefik_trusted_ips|default([]) %},{{ ip }}{% endfor %}' trusted_proxies: '127.0.0.1,REMOTE_ADDR{% for ip in traefik_trusted_ips|default([]) %},{{ ip }}{% endfor %}'
{%+ else %} {% else %}
trusted_proxies: '127.0.0.1,{% for ip in chill.proxy_ips %}{{ ip }}{% if not loop.last %},{% endif %}{% endfor %}' trusted_proxies: '127.0.0.1,{% for ip in chill.proxy_ips %}{{ ip }}{% if not loop.last %},{% endif %}{% endfor %}'
{%+ endif %} {% endif %}
trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port'] trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port']
parameters: parameters:
+3 -3
View File
@@ -2,7 +2,7 @@
framework: framework:
messenger: messenger:
transports: transports:
{% if chill.rabbitmq_install +%} {% if chill.rabbitmq_install %}
async: async:
dsn: '%env(RABBITMQ_URL)%/async' dsn: '%env(RABBITMQ_URL)%/async'
options: options:
@@ -13,9 +13,9 @@ framework:
async: ~ async: ~
auto_setup: true auto_setup: true
priority: '%env(RABBITMQ_URL)%/priority' priority: '%env(RABBITMQ_URL)%/priority'
{% else +%} {% else %}
async: 'doctrine://default' async: 'doctrine://default'
priority: 'doctrine://default' priority: 'doctrine://default'
{% endif +%} {% endif %}
failed: 'doctrine://default?queue_name=failed' failed: 'doctrine://default?queue_name=failed'
sync: 'sync://' sync: 'sync://'
+4 -4
View File
@@ -29,11 +29,9 @@ monolog:
type: stream type: stream
path: "%kernel.logs_dir%/default-%log_prefix%.log" path: "%kernel.logs_dir%/default-%log_prefix%.log"
level: info level: info
channels: [ '!event', '!doctrine', '!console', '!chill' ] channels: [ '!event', '!doctrine', '!console', '!chill', '!deprecation']
deprecation_log: deprecation_log:
type: stream type: 'null'
path: "%kernel.logs_dir%/deprecation-%log_prefix%.log"
level: info
channels: [ 'deprecation' ] channels: [ 'deprecation' ]
console: console:
type: console type: console
@@ -41,3 +39,5 @@ monolog:
level: error level: error
channels: [ '!event', '!doctrine', '!console', '!deprecation'] channels: [ '!event', '!doctrine', '!console', '!deprecation']
bubble: true bubble: true
+10 -1
View File
@@ -24,7 +24,7 @@ NOTIFICATION_FROM_EMAIL={{ chill.chill_config.notification_from_email }}
ASYNC_UPLOAD_TEMP_URL_BASE_PATH= ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
ASYNC_UPLOAD_TEMP_URL_CONTAINER= ASYNC_UPLOAD_TEMP_URL_CONTAINER=
ASYNC_UPLOAD_TEMP_URL_KEY= ASYNC_UPLOAD_TEMP_URL_KEY=
DEFAULT_CARRIER_CODE=FR DEFAULT_CARRIER_CODE={{ chill.chill_config.default_carrier_code }}
APP_SECRET={{ chill.chill_config.app_secret }} APP_SECRET={{ chill.chill_config.app_secret }}
ADMIN_PASSWORD={{ chill.chill_config.admin_password }} ADMIN_PASSWORD={{ chill.chill_config.admin_password }}
{% if chill.chill_config.admin_password_1 is defined -%} {% if chill.chill_config.admin_password_1 is defined -%}
@@ -36,6 +36,12 @@ ADMIN_PASSWORD_2={{ chill.chill_config.admin_password_2 }}
{% if chill.chill_config.admin_password_3 is defined -%} {% if chill.chill_config.admin_password_3 is defined -%}
ADMIN_PASSWORD_3={{ chill.chill_config.admin_password_3 }} ADMIN_PASSWORD_3={{ chill.chill_config.admin_password_3 }}
{% endif -%} {% endif -%}
{% if chill.chill_config.admin_password_4 is defined -%}
ADMIN_PASSWORD_4={{ chill.chill_config.admin_password_4 }}
{% endif -%}
{% if chill.chill_config.admin_password_5 is defined -%}
ADMIN_PASSWORD_5={{ chill.chill_config.admin_password_5 }}
{% endif -%}
MAILER_DSN={{ chill.chill_config.mailer_dsn }} MAILER_DSN={{ chill.chill_config.mailer_dsn }}
MAILER_URL={{ chill.chill_config.mailer_url }} MAILER_URL={{ chill.chill_config.mailer_url }}
JWT_PASSPHRASE={{ chill.chill_config.jwt_passphrase }} JWT_PASSPHRASE={{ chill.chill_config.jwt_passphrase }}
@@ -47,3 +53,6 @@ RABBITMQ_URL=amqp://{{ chill.chill_config.rabbitmq_user }}:{{ chill.chill_config
DATABASE_URL=postgres://{{ chill.chill_config.database_user }}:{{ chill.chill_config.database_password }}@{% if chill.add_postgres %}database:5432{% else %}{{ chill.chill_config.database_host }}{% endif %}/{{ chill.chill_config.database_name }}?sslmode=prefer&charset=utf8&serverVersion={{ chill.chill_config.database_version }} DATABASE_URL=postgres://{{ chill.chill_config.database_user }}:{{ chill.chill_config.database_password }}@{% if chill.add_postgres %}database:5432{% else %}{{ chill.chill_config.database_host }}{% endif %}/{{ chill.chill_config.database_name }}?sslmode=prefer&charset=utf8&serverVersion={{ chill.chill_config.database_version }}
EDITOR_SERVER={{ chill.chill_config.editor_server }} EDITOR_SERVER={{ chill.chill_config.editor_server }}
OVHCLOUD_DSN={{ chill.chill_config.ovhcloud_dsn }} OVHCLOUD_DSN={{ chill.chill_config.ovhcloud_dsn }}
{% for k, v in chill.chill_config.supplementary_environment_values.items() %}
{{ k }}="{{ v }}"
{% endfor %}
+3 -12
View File
@@ -1,26 +1,17 @@
/var/log/chill/default-*.log { /var/log/chill/*.log {
su php-fpm php-fpm su php-fpm php-fpm
rotate 90
daily daily
compress compress
missingok missingok
notifempty notifempty
copytruncate
rotate 90
} }
/var/log/chill/privacy-*.log { /var/log/chill/privacy-*.log {
su php-fpm php-fpm
rotate 180 rotate 180
daily
compress
missingok
notifempty
} }
/var/log/chill/notifier-*.log { /var/log/chill/notifier-*.log {
su php-fpm php-fpm
rotate 800 rotate 800
daily
compress
missingok
notifempty
} }
+3 -3
View File
@@ -1,4 +1,4 @@
# this file is managed by ansible. Do not edit it by hand # this file is managed by ansible. Do not edit it by hand
POSTGRES_DB={{ item.chill_config.database_name }} POSTGRES_DB={{ chill.chill_config.database_name }}
POSTGRES_USER={{ item.chill_config.database_user }} POSTGRES_USER={{ chill.chill_config.database_user }}
POSTGRES_PASSWORD={{ item.chill_config.database_password }} POSTGRES_PASSWORD={{ chill.chill_config.database_password }}
+2 -2
View File
@@ -1,3 +1,3 @@
# this file is managed by ansible. Do not edit it by hand. # this file is managed by ansible. Do not edit it by hand.
RABBITMQ_DEFAULT_USER={{ item.chill_config.rabbitmq_user }} RABBITMQ_DEFAULT_USER={{ chill.chill_config.rabbitmq_user }}
RABBITMQ_DEFAULT_PASS={{ item.chill_config.rabbitmq_password }} RABBITMQ_DEFAULT_PASS={{ chill.chill_config.rabbitmq_password }}
+1 -1
View File
@@ -3,7 +3,7 @@ Description=Execute send-short-messages for chill with environment %i
[Service] [Service]
User={{ as_user }} User={{ as_user }}
ExecStart=/usr/bin/docker compose --file {{ install_dir }}/%i/compose.yaml run cron bin/console chill:calendar:send-short-messages ExecStart=/usr/bin/docker compose --file {{ install_dir }}/%i/compose.yaml run --rm cron bin/console chill:calendar:send-short-messages
Type=simple Type=simple
# execute maximum 30 minutes # execute maximum 30 minutes
RuntimeMaxSec=1800 RuntimeMaxSec=1800