`docker events` shows `health_status: unhealthy` flapping every minute.
IntermediateTroubleshootingResources, health checks, logging and restarts
Answer
Likely causes → Health command timing out under load (timeout 1s default 30s interval depending on setting), GC pauses, dependency checks too strict.
Diagnose → docker inspect -f '{{range .State.Health.Log}}{{.Start}} {{.ExitCode}} {{.Output}}{{end}}' c.
Fix → Lighter health endpoint, larger timeout/retries, separate liveness from dependency checks.
Prevent → Make health endpoints cheap and cached.
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.BeginnerContainer is `unhealthy` but the app works when tested manually.Intermediate`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`.Intermediate