Private connection between two containers not working

mbenkertPRO

a year ago

[Also posted in the forums, but for better visibility also posting here]

Hey, maybe this is trivial, but I am quite new to the world of deployment and that kind of stuff and can't seem to figure out what the problem could be.

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. (servicename.railway.internal|servicename)

So in full length the URL I am trying to reach from c1 is https://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

1 Replies

mbenkertPRO

a year ago

N/A


a year ago

Make sure you're using http and not https


mbenkertPRO

a year ago

Yea, I actually had http before. Did not change anything sadly.


a year ago

that's strange 🤔


mbenkertPRO

a year ago

If I generate a public domain service_[name-production.up.railway.app](name-production.up.railway.app) and use that for my request through Postman https://service_[name-production.up.railway.app](name-production.up.railway.app)/v1/endpoint I can normally reach that endpoint and get the results - but I need it to be a private point and not reachable by the public …


a year ago

closing out in favor of the help station post.


mbenkertPRO

a year ago

For anyone stumbling over this thread in the future: I simply had to change from IPv4 to IPv6 on my service that is listening (0.0.0.0 -> :: ) and then I could reach it from my other services.


Status changed to Awaiting Railway Response railway[bot] • 11 months ago


Status changed to Solved brody • 11 months ago