17 Commits

Author SHA1 Message Date
Serreau Jovann
7e2706b04f Pin Meilisearch image to v1.40.0 to match database version and prevent incompatible auto-upgrades
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 14:06:16 +02:00
Serreau Jovann
a139feef07 init 2026-04-01 17:19:13 +02:00
Serreau Jovann
3bb676bfda Adjust container resource limits for 6 CPU / 30 GB RAM server
Resource allocation (limits / reservations):
- php x2:        1.5 CPU / 1G    |  0.5 CPU / 256M
- db-master:     2.0 CPU / 4G    |  0.5 CPU / 1G    (shared_buffers=1GB, effective_cache_size=3GB)
- db-slave:      1.5 CPU / 2G    |  0.25 CPU / 512M
- pgbouncer:     0.5 CPU / 128M  |  0.1 CPU / 32M
- messenger x2:  1.0 CPU / 512M  |  0.25 CPU / 128M
- redis:         1.0 CPU / 1G    |  0.25 CPU / 128M  (maxmemory 768mb)
- meilisearch:   1.0 CPU / 1G    |  0.25 CPU / 256M

Total max with replicas: ~12 CPU / ~13G RAM (overcommit OK, reservations fit)
Total reservations: ~3.6 CPU / ~4G RAM (guaranteed minimum)
Added PostgreSQL tuning: shared_buffers, effective_cache_size, work_mem.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:25:35 +01:00
Serreau Jovann
04c9df7638 Add CPU and memory limits to all production containers
Resource allocation (limits / reservations):
- php x2:        1.0 CPU / 512M  |  0.25 CPU / 128M
- db-master:     1.5 CPU / 2G    |  0.5 CPU / 512M
- db-slave:      1.0 CPU / 1G    |  0.25 CPU / 256M
- pgbouncer:     0.25 CPU / 64M  |  0.05 CPU / 16M
- messenger x2:  0.5 CPU / 384M  |  0.1 CPU / 64M
- redis:         0.5 CPU / 256M  |  0.1 CPU / 64M  (maxmemory 200mb)
- meilisearch:   0.5 CPU / 512M  |  0.1 CPU / 128M

Total max: ~8.5 CPU / ~6.5G RAM (with 2 php + 2 messenger replicas)
Redis maxmemory with allkeys-lru eviction policy added.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:24:27 +01:00
Serreau Jovann
7a370b1e02 Fix Docker socket access: add docker GID to PHP container group
The PHP container user needs the docker group to read the socket.
Uses DOCKER_GID env var in dev (defaults to 989) and dynamic GID
detection via Ansible stat in prod.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:53:28 +01:00
Serreau Jovann
8db44017d2 Redesign admin Infra page: full-screen 4-column layout with Docker stats
Complete rewrite of /admin/infra into 4 columns:
- Col 1 (Serveur): CPU, RAM, Disk, System, Services (Caddy, Docker, SSL cert)
- Col 2 (Containers): All Docker containers with CPU%, RAM, state via Docker API
- Col 3 (Redis): Global stats + per-DB (Messenger, Sessions, Cache)
- Col 4 (PostgreSQL): Instance stats + PgBouncer pools/stats

Extract all infra logic into InfraService. Mount Docker socket (read-only)
in PHP container for container stats. Check SSL cert expiry and Caddy status.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:51:04 +01:00
Serreau Jovann
3a7f92c02d Remove Meilisearch healthcheck, use service_started instead
The getmeili/meilisearch image (Debian slim) has neither curl nor wget,
so healthcheck commands always fail. Use condition: service_started
and rely on Messenger retry mechanism for brief startup delays.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:32:22 +01:00
Serreau Jovann
264a82a97c Fix Meilisearch healthcheck: use wget instead of curl
The getmeili/meilisearch image does not include curl, causing the
healthcheck to fail and blocking messenger startup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:24:35 +01:00
Serreau Jovann
23b92f101c Add admin event actions (online/offline, edit, delete) and fix Meilisearch depends_on
- Add toggle online/offline and delete routes in AdminController
- Add action buttons (En ligne, Modifier, Supprimer) in admin events template
- Bypass requireEventOwnership and requireStripeReady for ROLE_ROOT so admin can edit any event
- Add Meilisearch healthcheck and depends_on in messenger service (prod + dev)
- Add tests for all new admin routes and ROLE_ROOT bypass

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 09:04:27 +01:00
Serreau Jovann
2987dbfd28 Fix Redis session DSN, remove LibreTranslate from prod, track all translations
- Fix SESSION_HANDLER_DSN: use Redis db index (/1) instead of /sessions
  which caused "dbindex must be a number" error
- Remove LibreTranslate service and volume from docker-compose prod
- Remove gitignore rules for translation files (en, es, de, it)
  so all languages are tracked in git
- Apply PHP CS Fixer style fixes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:35:13 +01:00
Serreau Jovann
da0076fa51 aa 2026-03-23 16:58:27 +01:00
Serreau Jovann
f45a348b2b Add healthcheck to pgbouncer and wait for healthy before starting php/messenger
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 14:20:42 +01:00
Serreau Jovann
b61889d01d Add explicit e-ticket bridge network to all services in docker-compose-prod
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 14:16:10 +01:00
Serreau Jovann
8dfaf0c9c8 Fix DB connectivity: remove host network, add wait for database before migration
- Remove unused host network from docker-compose-prod template
- Add 30s wait loop for pgbouncer connectivity before running migrations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 14:12:04 +01:00
Serreau Jovann
de945add75 Fix PgBouncer auth: template pgbouncer.ini and userlist.txt with vault db_password
- Create pgbouncer.ini.j2 with auth_type plain (no MD5 hash needed)
- Create userlist.txt.j2 with vault db_password
- Add Ansible tasks to deploy both files before docker-compose
- Mount pgbouncer files as read-only in compose template

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 14:07:16 +01:00
Serreau Jovann
08704c9824 Fix PostgreSQL replication: add pg_hba.conf entries for replicator user
- Create init-master.sh that runs SQL and appends replication rules to pg_hba.conf
- Switch docker-compose-prod template from init-master.sql to init-master.sh
- Fixes "no pg_hba.conf entry for replication connection" error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:45:58 +01:00
Serreau Jovann
d11c0cbea4 Convert docker-compose-prod.yml to Ansible template with vault secrets
- Create docker-compose-prod.yml.j2 with vault variables (db_password, redis_password, meilisearch_master_key)
- Add template deployment step in playbook after stop containers
- Remove docker-compose-prod.yml from git tracking (now generated by Ansible)
- Add docker-compose-prod.yml to .gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:26:38 +01:00