title: GitLab CI & Docker: wait till docker-compose up is finished
body: <p>I'm trying to build a CI Pipeline with Gitlab CI/CD. My project is a really simple API based on Symfony. To create a consistent environment i'm using docker-compose with four very simple containers (nginx,PHP,MySQL &amp; composer). My .gitlab-ci.yaml looks like this:</p>
  
  <pre><code>stages:
      - setup
  
  setup:
    stage: setup
  
    before_script:
      - docker-compose up -d
  
    script:
      - sleep 15
      - docker-compose exec -T php php bin/console doctrine:schema:create
    after_script:
      - [...] 
      - docker-compose down
  </code></pre>
  
  <p>The problem I'm encountering is that the ci script does not wait till the <code>docker-compose up -d</code> is finished. To bypass this I've added this stupid sleep. </p>
  
  <p>Is there a better way to do this? </p>