Tried this : D:\Code\MongoDB1\MongoDB1>dotnet restore
Restore complete (0.0s)
Build succeeded in 0.1s
D:\Code\MongoDB1\MongoDB1>dotnet run --urls http://localhost:5000
Using launch settings from D:\Code\MongoDB1\MongoDB1\Properties\launchSettings.json…
Pinged your deployment. You successfully connected to MongoDB! v2.0
Though, on Windows Docker Desktop will use a utility VM to run Linux containers. You should be able to connect to published ports using localhost:<published host port> or 127.0.0.1:<published host port>. Your screenshot shows a domain name. Does this domain resolve to localhost or the hosts public domain name?
Or are you running Windows Containers (with or without Docker Desktop)?