0

This only occurs whenever building the project docker-compose.yml but for some reason, docker doesn't wait for the port to become active and then execute the next service.

My question is: if there is any way to do this without using wait-for-it or programs similar to it

docker-compose logs:

enter image description here


Edit: I have also tried this which was unsuccessful.

Thanks in advance!

  • maybe this can help you ? https://stackoverflow.com/questions/52699899/depends-on-doesnt-wait-for-another-service-in-docker-compose-1-22-0 – Atin Singh Apr 10 '20 at 16:32
  • it already has restart always, also tried your suggestion it doesn't fix the issue –  Apr 10 '20 at 16:36

1 Answers1

0

depends_on means only that it will wait when container starts but it does not mean that service inside that container is ready. Look here how you have to wait for db is ready https://github.com/api-platform/api-platform/blob/master/api/docker/php/docker-entrypoint.sh#L29

d0niek
  • 218
  • 1
  • 12