Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add health checks for services #225

Closed
lmakarov opened this issue May 19, 2017 · 1 comment
Closed

Add health checks for services #225

lmakarov opened this issue May 19, 2017 · 1 comment
Assignees
Milestone

Comments

@lmakarov
Copy link
Member

lmakarov commented May 19, 2017

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

@lmakarov
Copy link
Member Author

lmakarov commented Jun 6, 2017

After implementing a healthcheck for docksal/cli I stumble upon this:
docker/compose#4305 (comment)

Docker has introduced healthchecks support in docker-compose format v2.1 just to then drop it in v3 🤦‍♂️

https://docs.docker.com/compose/compose-file/

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants