title: Bash script command to wait until docker-compose process has finished before moving on
body: <p>We have a bash script that installs a program, which includes running a <code>docker-compose</code> file. One of the services, RabbitMQ, takes some time to load and I need a command to wait until it's loaded before the other services are loaded. We were using a <code>sleep</code> command, but our customers use different laptops, so it takes longer to load on some than others. Is there a way to just hold it until it finishes loading the service before moving on to the next without using the <code>sleep</code> command? I have included the part of the script below. Thanks!</p>
  
  <pre><code># Execute applications
  cd /opt/program
  docker-compose up -d
  echo "waiting for message queue..."
  sleep 15
  
  echo "starting ingest manager"
  
  cd /opt/program/scripts
  chmod +x start-manager.sh
  ./start-manager.sh &amp;
  </code></pre>