You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several things to be aware of when using depends_on:
depends_on will not wait for db and redis to be “ready” before starting web - only until they have been started. If you need to wait for a service to be ready, see Controlling startup order for more on this problem and strategies for solving it.
Version 3 no longer supports the condition form of depends_on.
The depends_on option is ignored when deploying a stack in swarm mode with a version 3 Compose file.
So we can either have this now or the ability to deploy to a swarm mode docker cluster in the future.
Unless docker changes their mind again.
Docker Compose file format v2.1+ and Docker v1.12.0+ support health checks:
https://docs.docker.com/compose/compose-file/#healthcheck
https://docs.docker.com/engine/reference/builder/#healthcheck
Health checks will eliminate the need of guess work and random
sleep x
in fin for the services (db and cli primarily).Here and example of how this can be set up via just the compose file:
http://stackoverflow.com/questions/31746182/docker-compose-wait-for-container-x-before-starting-y/41854997#41854997
The text was updated successfully, but these errors were encountered: