Docker Compose is a kind of client for Docker. Features that Docker doesn’t support are used for developement and in some cases to make sure the first started container can initialize data which will be mounted by another container as well. So when you first start the container, the order of the containers are more important. I never used the depends_on
feature with healthchecks as the applications should handle when a dependency is not available. If the app fails because it can’t access an endpoint and the container restarts, it can try again. Or endpoint checking can be added in a loop in the entrypoint before the application starts and run until the endpoint is ready. This works regardless of how where your containers are running (Kubernetes, Swarm, Compose).