klutchell / mediaserver

docker-based plex & usenet media server using custom subdomains with tls

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Depends on instead of wait-for-it.sh

lsc opened this issue · comments

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?

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/