Add PgBouncer to dev and PgBouncer stats to admin Infra page

- Add pgbouncer service to docker-compose-dev.yml with dev config
- Route DATABASE_URL through pgbouncer:6432 in dev (matches prod)
- Add PgBouncer pools and stats tables to /admin/infra with color-coded
  avg query/xact times and client waiting indicators
- php, messenger, cron now depend on pgbouncer instead of database directly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-26 10:33:51 +01:00
parent 1a336edac5
commit 74c10a60f5
7 changed files with 204 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ services:
ports:
- "9000:9000"
depends_on:
database:
pgbouncer:
condition: service_healthy
redis:
condition: service_healthy
@@ -32,6 +32,23 @@ services:
timeout: 5s
retries: 5
pgbouncer:
image: edoburu/pgbouncer
container_name: e_ticket_pgbouncer
volumes:
- ./docker/pgsql/pgbouncer-dev.ini:/etc/pgbouncer/pgbouncer.ini:ro
- ./docker/pgsql/userlist-dev.txt:/etc/pgbouncer/userlist.txt:ro
ports:
- "6432:6432"
depends_on:
database:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -p 6432 -U app"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: e_ticket_redis
@@ -67,7 +84,7 @@ services:
volumes:
- .:/app
depends_on:
database:
pgbouncer:
condition: service_healthy
redis:
condition: service_healthy
@@ -162,7 +179,7 @@ services:
volumes:
- .:/app
depends_on:
database:
pgbouncer:
condition: service_healthy
redis:
condition: service_healthy