fix: add symfony/redis-messenger + real healthchecks

worker-async crashed in a loop with 'No transport supports Messenger DSN
redis://...' because symfony/redis-messenger was never installed — 10x restart
killed the whole stack. Add the package (v7.4.8).

Also harden healthchecks:
- app: hit the real /health route via PHP get_headers (verifies app boots and
  serves, not just that port 80 is open)
- workers: confirm the messenger:consume process is alive via busybox ps

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-06-28 14:54:45 +03:30
co-authored by Claude Opus 4.8
parent 61ffb2ecd8
commit 7af3b5a600
3 changed files with 354 additions and 259 deletions
+17 -1
View File
@@ -64,8 +64,11 @@ services:
RUN_INIT: "1" # runs JWT keygen + migrations on start (only this service)
volumes: *app-volumes
networks: [coolify]
# Hit the real /health route through nginx+fpm — verifies the app actually
# boots and serves (not just that port 80 is open). Uses PHP (always present)
# so we don't depend on curl/wget being in the image; fails on non-2xx.
healthcheck:
test: ["CMD", "php", "-r", "exit(@fsockopen('127.0.0.1', 80) ? 0 : 1);"]
test: ["CMD", "php", "-r", "$h=@get_headers('http://127.0.0.1:80/health'); exit($h && strpos($h[0],'200')!==false ? 0 : 1);"]
interval: 15s
timeout: 5s
retries: 5
@@ -82,6 +85,13 @@ services:
volumes: *app-volumes
networks: [coolify]
depends_on: [app]
# No port to probe — just confirm the consumer process is alive (busybox ps).
healthcheck:
test: ["CMD-SHELL", "ps -o args 2>/dev/null | grep -q '[m]essenger:consume async' || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
# Scheduler consumer — expires unpaid appointments every minute. Reuses app's image.
worker-scheduler:
@@ -94,6 +104,12 @@ services:
volumes: *app-volumes
networks: [coolify]
depends_on: [app]
healthcheck:
test: ["CMD-SHELL", "ps -o args 2>/dev/null | grep -q '[m]essenger:consume scheduler_default' || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
volumes:
jwt_keys: