I'm using Docker Compose for integration tests. After starting a cluster with Docker Compose I need to wait for some time until the application and its cache is up. I see ways to make one container wait before starting another but is there a way to make the whole set up wait?
Thank you in advance!
You need to work out what you mean by the "cluster is up". Docker doesn't really care too much about what the application inside each container is doing, so long as it doesn't terminate.
If you need to wait for some state transitions inside the containers, you'll need to manage this at the application level - for instance, you could write to a file on a filesystem exposed from the container, you could HTTP POST a message somewhere, etc, etc. Then pick up that message and use that to start your integration test. I'd strongly consider reusing whatever you're using for your monitoring infrastructure, as this is effectively the same problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With