Cannot connect to an ASP.NET Core 6 application running inside a docker container

I managed to get it to work by changing the urls for the hot reload profile in launch settings from http(s)://localhost:port to http(s)://0.0.0.0:port. Dotnet watch does not seems work work well with the localhost url.