Corn
Corn
CC#
Created by Corn on 3/12/2024 in #help
Docker-compose not working with localhost redirect
I'm kinda new with docker and yarp so I probably made some basic mistake. For context: I have a yarp gateway created in asp.net core web api and a micro-service also in asp.net core web api. When I go to the gateway url I want it to redirect to the micro-service. I was able to get this to work in two seperate containers. However when I try to use docker-compose it wont work. The error I get the most is (http error 503) cannot assign requested address from my docker container. I have tried host.docker.internal but it yielded no results.
System.Net.Http.HttpRequestException: Cannot assign requested address (localhost:5101)
2024-03-12 10:06:02 ---> System.Net.Sockets.SocketException (99): Cannot assign requested address
System.Net.Http.HttpRequestException: Cannot assign requested address (localhost:5101)
2024-03-12 10:06:02 ---> System.Net.Sockets.SocketException (99): Cannot assign requested address
I can't send the rest of the code as it's too long for this message xd It can be viewed here however "https://stackoverflow.com/questions/78145912/docker-compose-not-working-with-localhost-redirect"
4 replies