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?
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 reachable
PS C:WINDOWSsystem32> 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_GateWayAPI992797fe4689 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:WINDOWSsystem32> docker port 5573045eeade8080/tcp -> 0.0.0.0:599578081/tcp -> 0.0.0.0:59956PS C:WINDOWSsystem32> docker port 992797fe468927017/tcp -> 0.0.0.0:27018
New contributor
pasalvadi shambhavi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.