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

healthcheck condition is not supported in docker compose file v3 #15

Closed
mattscilipoti opened this issue Jul 7, 2021 · 1 comment
Closed

Comments

@mattscilipoti
Copy link

mattscilipoti commented Jul 7, 2021

Thanks for providing this resource. While attempting to get it working on my system, I think I have identified that it is not supported in docker compose v3. I found the first hint here: https://stackoverflow.com/a/59072727. I looked through the docs for v3 and cannot find "condition" or "service_healthy" (https://docs.docker.com/compose/compose-file/compose-file-v3/#depends_on).
Is it still working for you in v3? If not, maybe you could add a comment that it is supported by v2?

Here's their reasoning (from https://docs.docker.com/compose/startup-order/):

The problem of waiting for a database (for example) to be ready is really just a subset of a much larger problem of distributed systems. In production, your database could become unavailable or move hosts at any time. Your application needs to be resilient to these types of failures.
To handle this, design your application to attempt to re-establish a connection to the database after a failure. If the application retries the connection, it can eventually connect to the database.

Thanks for directing me to pg_isready

@peter-evans
Copy link
Owner

Hi @mattscilipoti

Please see issue #3 where this has been resolved.

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

No branches or pull requests

2 participants