Depends on instead of wait-for-it.sh
lsc opened this issue · comments
Lowe Schmidt commented
Would using the built in depends on for docker compose (https://docs.docker.com/compose/compose-file/#depends_on) be a suitable replacement for the wait-for-it.sh script?
Kyle Harding commented
Good question! I've actually tried both methods in the past.
As I understand it, depends_on
only affects the container start/restart order, and not whether or not the other service is actually ready to receive connections. Whereas wait-for-it actually uses nc -z
to check for an active daemon on a port.
Check out this page where I found the info: https://docs.docker.com/compose/startup-order/