Private connection between two containers not working
mbenkert
PROOP

2 years ago

Hey, maybe this is trivial, but I can't seem to figure out what the problem is.

I have two services (containers) running. One container (c1) is hosting a Django web application on port 8001. The other service (c2) is running on port 8000 and has some endpoint v1/endpoint up and running.

I now want to request this endpoint from within my first container (c1) over the private network adress.

I have tried to use both the long and the short form of the specified adress displayed under the settings from c2. (service_name.railway.internal|service_name)

So in full length the URL I am trying to reach from c1 is http://service_name:8000/v1/endpoint, which is not working.

Originally, I tested it locally, where I had two Docker containers running. There, I also encountered the issue that they could not connect, but I could fix it by establishing a network between them and then also simply calling the second container by its name and the exposed port.

Am I missing something here/do I need to do something additionally such that c1 can reach c2?

Hope anyone can help me out here by giving me a hint! :)

Best regards,

Marius

Solved

4 Replies

2 years ago

Hey, unfortunately not working isn't super helpful, please share the exact errors you are getting.

Additionally, the private network is IPv6 only, so make sure your apps are listening on ::


2 years ago

^ yup, I would ensure that c2 is listening on ::


Status changed to Awaiting User Response Railway over 1 year ago


mbenkert
PROOP

2 years ago

Hey, thanks for both your answers.

Yes, I agree, that my error sharing was subpar and not really helpful - will work on that the next time! :)

You guys were right, I simply did not use IPv6. Having changed that made it work! So thank you to both of you.


Status changed to Awaiting Railway Response Railway over 1 year ago


2 years ago

Glad you got it working!


Status changed to Solved brody over 1 year ago


Loading...