0

How to wait until dependent services are available in docker-compose

Elasticsearch runs on a different machine and if my application is started via docker-compose it fails to start. But how do I wait, until the elasticsearch instance is available and running on a different machine so that the application can start

Rpj
  • 4,194
  • 12
  • 43
  • 94

1 Answers1

0

one option could be to use wait-for-it

wait-for-it.sh is a pure bash script that will wait on the availability of a host and TCP port. It is useful for synchronizing the spin-up of interdependent services, such as linked docker containers. Since it is a pure bash script, it does not have any external dependencies.

Here is another SO that asks the same question.

Ryan.Bartsch
  • 2,949
  • 1
  • 17
  • 41