Closed polRk closed 6 months ago
Procfile is a very simple format that doesn't support health checks. Applications that use it can't determine the readiness of processes and thus can't make processes wait for their dependencies' readiness.
Yeah I normally make each process that connects to another process have an exponential back off / retry.
mots good practice too . Never know what is going on under the covers so best to be pessimistic
You could probably hack this by putting in a sleep for a few milliseconds:
web: sleep 0.5 && server start
Alternatively, there are approaches like testing if a port is open:
nc -w 0.5 ${HOSTNAME} ${PORT} < /dev/null &> /dev/null
The above uses netcat
to connect to the port, waiting for 0.5 seconds at most for the connection to establish.
Like in docker-compose i can specify