Hi,
I am new to docker/container. I created two ASP.NET MVC projects. “MyWebsite” was the web portal and “MyAPI” was the Web API. The web portal invokes the web API to get a string and display it on the web page.
When I launch them from Visual Studio’s docker-compose, both are accessible from my dev PC, one as “http:||localhost:52000” and one as “http:||localhost:52001”. But the web portal could not reach the API.
This is what I have done:
-
I found the host PC’s internal IP address which the container can access, 172.20.64.1, using ipconfig. It was the one against the long GUID.
-
On my host PC’s firewall, I allowed PING. I also allowed all incoming and outgoing connections at port 1024-65535.
After that, I can ping from the MyWebsite container this host IP address:
`docker exec -it MyWebsite ping 172.26.176.1`
But, when MyWebsite tries to invoke MyAPI by this IP address, which is
http:||172.20.64.1:52001/api/values/5
It can’t reach it.
What can I do? Please help. Thanks.