Docker: healthcheck and depends_on
Introduction
This post mainly covers the mechanisms and syntax of Docker healthcheck and Docker Compose's depends_on. This post can be viewd as a cheat sheet.
healthcheck Mechanism
When a container has a healthcheck specified, it has a health status in addition to its normal status. This status is initially
starting. Whenever a health check passes, it becomeshealthy(whatever state it was previously in). After a certain number of consecutive failures, it becomesunhealthy.
