Click here to Skip to main content
16,022,060 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed an API using Docker on Windows. While running inside Visual Studio, I can access the URL without any issues. However, after stopping Visual Studio and deploying the application, the URL becomes unreachable when accessed through Docker. I switched Docker to Windows containers before starting it and am running Docker on Windows 11. The URL 
   https://localhost:59956/index.html
 is accessible when running on Visual Studio, but not when accessed through Docker. Can anyone help me figure out this issue?


What I have tried:

below are the containers
I am able to access with URL 'https://localhost:59956/index.html' when running from vs when stopped vs debugging try to access from docker not bale to reach
PS C:\WINDOWS\system32> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5573045eeade hongatewayapi:dev "C:\\remote_debugger\\…" About an hour ago Up 3 minutes 0.0.0.0:59957->8080/tcp, 0.0.0.0:59956->8081/tcp HON_GateWayAPI
992797fe4689 mongo:7.0 "mongod --bind_ip_all" 23 hours ago Up 3 minutes 0.0.0.0:27018->27017/tcp mongodb_new_v2
PS C:\WINDOWS\system32> docker port 5573045eeade
8080/tcp -> 0.0.0.0:59957
8081/tcp -> 0.0.0.0:59956
PS C:\WINDOWS\system32> docker port 992797fe4689
27017/tcp -> 0.0.0.0:27018
Posted
Updated 30-Jul-24 1:15am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900