I don't want to increase the startup time of the second container as this happens only at the first time I initialize the container. './mysql/scripts:/docker-entrypoint-initdb.d' So when i start the containers for the first time, my server exits with error code as the tables are not created yet. Also I have added my SQL scripts into '/docker-entrypoint-initdb.d' so that the tables will be created at the startup.But, wait-for-it.sh only wait until the MySQL server is ready to start communicating,not until all the tables are created(MySQL server is idle). I am using Docker-compose version 3 and use wait-for-it.sh to wait till the MySQL container is started before starting the server container. I cannot handle this from server side as it is not a product that I own. I want my second container to wait until the MySQL docker image finish creating tables. In order to start this server I want the MySQL tables to be created first,otherwise the server exits giving an error. I'm trying to start a Docker container of a server which uses MySQL as it's database.