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:
+7
-6
@@ -9,7 +9,7 @@
|
||||
"php": ">=8.2",
|
||||
"ext-ctype": "*",
|
||||
"ext-iconv": "*",
|
||||
"doctrine/doctrine-bundle": "*",
|
||||
"doctrine/doctrine-bundle": ">=2.18.3",
|
||||
"doctrine/doctrine-migrations-bundle": "*",
|
||||
"doctrine/orm": "^3.6",
|
||||
"lexik/jwt-authentication-bundle": "*",
|
||||
@@ -26,6 +26,7 @@
|
||||
"symfony/property-access": "7.4.*",
|
||||
"symfony/property-info": "7.4.*",
|
||||
"symfony/rate-limiter": "7.4.*",
|
||||
"symfony/redis-messenger": "7.4.*",
|
||||
"symfony/runtime": "7.4.*",
|
||||
"symfony/scheduler": "7.4.*",
|
||||
"symfony/security-bundle": "7.4.*",
|
||||
@@ -34,10 +35,10 @@
|
||||
"symfony/uid": "7.4.*",
|
||||
"symfony/ux-react": "^2.36",
|
||||
"symfony/validator": "7.4.*",
|
||||
"symfony/webpack-encore-bundle": "^2.4",
|
||||
"symfony/webpack-encore-bundle": "^2.4.1",
|
||||
"symfony/yaml": "7.4.*",
|
||||
"twig/twig": "*",
|
||||
"zircote/swagger-php": "*"
|
||||
"zircote/swagger-php": ">=6.2"
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
@@ -91,9 +92,9 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^2.2",
|
||||
"phpstan/phpstan-doctrine": "^2.0",
|
||||
"phpstan/phpstan-symfony": "^2.0",
|
||||
"phpunit/phpunit": "^12.5",
|
||||
"phpstan/phpstan-doctrine": "^2.0.27",
|
||||
"phpstan/phpstan-symfony": "^2.0.20",
|
||||
"phpunit/phpunit": "^12.5.30",
|
||||
"symfony/browser-kit": "7.4.*",
|
||||
"symfony/css-selector": "7.4.*",
|
||||
"symfony/debug-bundle": "7.4.*",
|
||||
|
||||
Generated
+330
-252
File diff suppressed because it is too large
Load Diff
+17
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user