One of my tasks is containerizing an ASP.NET Core 8 application and configuring it to work with a single command "docker-compose up". I developed the application in ASP.NET Core 8 using C#. This is my first experience with Docker.
I have managed to set it up so that when I run the project from Visual Studio with Docker Compose (button), everything works fine. However, when I run docker-compose up
in PowerShell, the application starts without errors, but I can’t access it in the browser no matter which ports I try. I even added the ports to the Windows firewall, but it still doesn’t work. What am I doing wrong?
My github: https://github.com/baro0000/DockerTests
I tried changing ports, shutdown antivirus, firewall, restart and nothing helps.
2
Answers
Dzięki za odpowiedzi, dokładnie porty były problemem, przez co kontener bazy danych odrzucał połączenie. Wszystko działa 👍👍👍
You didn’t specify the pfx for https in "docker-compose.override.yml". I see you have the " docker-comose.debug.yml" so maybe you have tried this doc https://learn.microsoft.com/en-us/aspnet/core/security/docker-compose-https?view=aspnetcore-8.0#windows-using-linux-containers. If it works you could try with that default pfx first with similar configuration and explicit write the port mapping.