Container is `unhealthy` but the app works when tested manually.
IntermediateTroubleshootingResources, health checks, logging and restarts
Answer
Likely causes → Healthcheck command missing in the image (curl: not found), wrong port/path, too-short timeout, runs as a different user, or checks a dependency that's down.
Diagnose →
docker inspect -f '{{json .State.Health}}' c | jq
docker exec c sh -c 'curl -fsS http://localhost:8080/healthz; echo $?'
Fix → Install the needed tool or use the app binary, fix URL, raise timeout/start_period.
Prevent → Test the health command in CI.
More on Resources, health checks, logging and restarts
Container restarts repeatedly: `docker ps` shows `Restarting (1) 5 seconds ago`.Beginner`OOMKilled: true` and exit code 137.Beginner`docker stats` shows 100%+ CPU and the container is slow.Intermediate`docker logs` is slow or `docker logs -f` hangs on a container with huge logs.Intermediate`Error response from daemon: configured logging driver does not support reading` when running `docker logs`.IntermediateApplication hangs and logs stop: log driver blocking (`fluentd: connection refused`).Advanced