Can't access MYSQL privately from Nodejs app
I am getting error.
Solution:Jump to solution
for an alpine based docker image, please see this docs section https://docs.railway.app/guides/private-networking#workaround-for-alpine-based-images
10 Replies
Project ID:
ed9d81eb-a192-462c-8cf6-bf7778244e57
This is my dockerfile
Solution
for an alpine based docker image, please see this docs section https://docs.railway.app/guides/private-networking#workaround-for-alpine-based-images
I didn't find a rule about texting in someone else's thread, I hope it's ok for me to add to this, if not I apologize
Project ID: 4cc0d132-ab38-44ae-8c5c-8bfc804592eb
I had the same error as Piyush about reaching mysql on private networking from nodejs (expressjs)
I applied the alpine workaround, meaning that I've set that env variable on nodejs
now I'm getting a different error, a connection timeout
I've read this in the docs: "Note that using this workaround will cause the 100ms DNS initialization delay to impact both public and private networking."
could it be it?
nixpacks or dockerfile?
nixpacks
then the alpine variable is not applicable, please add a 3 second sleep to your start script
awesome, it lives! thank you mate
I'm guessing it was the same problem = private networking dns wasn't up fast enough?
and the fact that I got a different error after setting the alpine variable was a coincidence?
the docs say 100ms but in reality it's more like 2 seconds