title: Delayed container startup
body: <p>I have a Docker compose file consisting out of the app: digitalocean.com/php; a webserver: nginx:alpine and a db: mysql:5.7.22 container. My problem is, when I run "docker-compose up –d" I cannot access the webserver until I do a "docker restart webserver".</p>
  
  <p>I think I have to add a delayed start for the webserver, which I tried with the wait-for-it script:</p>
  
  <pre><code>  #Nginx Service
    webserver:
      image: nginx:alpine
      container_name: webserver
      restart: unless-stopped
      tty: true
      ports:
        - "80:80"
        - "443:443"
      volumes:
        - ./:/var/www
        - ./nginx/conf.d/:/etc/nginx/conf.d/
        - ./wait-for-it.sh:/wait-for-it.sh
      depends_on:
        - app
        - db
      entrypoint: ./wait-for-it.sh db:3306
      networks:
        - app-network
  </code></pre>
  
  <p>However, the problem still exists. Is the entrypoint call wrong or how can I achieve a delayed start?</p>
  
  <p>Thanks
  Stephan</p>