How do we start a docker container after a specific container is up

Viewed 25

I have a setup with 3 docker containers, containerX use RabbitMQ for communication.

  1. RabbitMQ container
  2. Container1
  3. Container2

Issue - When docker compose up is run, RabbitMq takes ~2s to be ready, by then the other containers start and exit as rabbimq is not up yet.

With restart: on-failure in compose file, the other containers are up once rabbitmq container is ready

Is there a way to avoid this and request other containers to wait until rabbitMQ(or a specific container) is up

or a possibility where once a docker container is up it triggers another docker container to start

0 Answers
Related