R
Railway3mo ago
mohsin

Waiting for service to deploy before another one starts deploying

I have 3 services, 1 is an nginx server, the other 2 are nextjs servers. Right now, the nginx server deploys relatively quicker than the nextjs servers and because of that, i am unable to access routes on any of my nextjs servers with the error:
*7 upstream timed out (110: Operation timed out) while connecting to upstream
*7 upstream timed out (110: Operation timed out) while connecting to upstream
How can I wait for my nextjs servers to deploy before depolying my nginx server?
8 Replies
Percy
Percy3mo ago
Project ID: N/A
mohsin
mohsin3mo ago
N/A
Brody
Brody3mo ago
railway does not support this natively unfortunately
mohsin
mohsin3mo ago
any other solutions? something i could do in my code?
Brody
Brody3mo ago
you would have to implement something yourself, yeah
mohsin
mohsin3mo ago
surely this is a common request, do you know of anyonne who has implemented this already? maybe i could add a sleep for the estimated amount of time it takes for the nextjs servers to deploy?
Brody
Brody3mo ago
I haven't seen anything besides using nc to wait for the database, but that's not exactly applicable to you a sleep would work yes
mohsin
mohsin3mo ago
sounds good i'll try that