Marius
Marius
RRailway
Created by Marius on 7/25/2024 in #✋|help
Private connection between two containers not working
[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. (service_name.railway.internal|service_name) 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
9 replies