Docker Compose Healthcheck - Marco Peg
https://marcopeg.com/docker-compose-healthcheckThe Docker Compose’s Way A simple way to solve the problem is to use the built-in health checks functionality available in docker-compose 2.1. We can basically tell a service to wait until another service (or multiple services) has completed a health check. Here is a docker-compose.yml with basic health checks set up for both Postgres and MySQL:
Docker Health Check - 简书
https://www.jianshu.com/p/b1712676278117.04.2019 · Docker 支持的 Health Check 可以是任何一个单独的命令,Docker 会在容器中执行该命令,如果返回 0,容器被认为是 healthy,如果返回 1,则为 unhealthy。 当一个容器有指定健康检查 (HEALTHCHECK) 时,它除了普通的容器状态之外,还有: starting : Initial status when the container is still starting healthy : 如果health check成功 unhealthy : If a single run of the …