I'm trying to use wait-for-it in my docker-compose.yaml
to wait for mysql to be ready before creating services that are dependent on it. This is my docker-compose.yaml
:
version: '3.5'
services:
mysql:
image: mysql:5.6
ports:
- "3307:3306"
networks:
- integration-tests
environment:
- MYSQL_DATABASE=mydb
- MYSQL_USER=root
- MYSQL_ROOT_PASSWORD=mypassword
entrypoint: ./wait-for-it.sh mysql:3306
networks:
integration-tests:
name: integration-tests
I get this error when trying to run this with docker-compose:
Starting integration-tests_mysql_1 ... error
ERROR: for integration-tests_mysql_1 Cannot start service mysql: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"./wait-for-it.sh\": stat ./wait-for-it.sh: no such file or directory": unknown
ERROR: for mysql Cannot start service mysql: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"./wait-for-it.sh\": stat ./wait-for-it.sh: no such file or directory": unknown ERROR: Encountered errors while bringing up the project.
The wait-for-it.sh
script is there on the same level as my docker-compose.yaml
file so I don't understand why it's not being found.