fix(deployment): Redis health check reads password directly from Docker Secret
The health check now reads the password directly from /run/secrets/redis_password instead of relying on an environment variable, which is not available in the health check context. This resolves the 'container application-redis-1 is unhealthy' error.
This commit is contained in:
@@ -209,9 +209,9 @@ services:
|
|||||||
cpus: '0.5'
|
cpus: '0.5'
|
||||||
|
|
||||||
# Stricter health checks
|
# Stricter health checks
|
||||||
# Uses REDIS_PASSWORD environment variable exported by entrypoint
|
# Health check reads password directly from Docker Secret
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "redis-cli -a \"$REDIS_PASSWORD\" ping | grep -q PONG"]
|
test: ["CMD-SHELL", "redis-cli -a \"$(cat /run/secrets/redis_password 2>/dev/null || echo '')\" ping | grep -q PONG"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user