Tune a health check for a slow-starting app (2 minutes boot).
IntermediateScenarioLimits, logging, health checks and restarts
Answer
Situation read → Early failures would mark it unhealthy.
What I'd do →
HEALTHCHECK --start-period=150s --interval=10s --timeout=3s --retries=3 \
CMD wget -qO- http://localhost:8080/healthz || exit 1
Why → Failures during start-period don't count toward retries, and the first success ends it.
Interview tip → Make sure wget/curl exists in the image.
More on Limits, logging, health checks and restarts
A Java container is OOM-killed at 512 MB. Why isn't the heap the whole story?IntermediateHow do you cap CPU and memory for a container and what happens on exceed?BeginnerLatency spikes though CPU usage looks low (50%).Advanced`docker logs` is empty but the app is running.BeginnerConfigure log rotation globally.BeginnerShip container logs to a central system.Intermediate