Add app:infra:snapshot command, page reads from var/infra.json

The /admin/infra page was slow because Docker stats API blocks per container.
Now a cron (every 5min) generates var/infra.json via app:infra:snapshot,
and the page reads the static JSON file instantly.
Mount Docker socket in cron container for snapshot access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-26 11:19:26 +01:00
parent 7a370b1e02
commit d2fb17bf50
6 changed files with 78 additions and 2 deletions

View File

@@ -179,8 +179,11 @@ services:
dockerfile: Dockerfile
container_name: e_ticket_cron
restart: unless-stopped
group_add:
- "${DOCKER_GID:-989}"
volumes:
- .:/app
- /var/run/docker.sock:/var/run/docker.sock:ro
depends_on:
pgbouncer:
condition: service_healthy