I am trying to setup a dotnet core development environment with docker. I am referring to the following guide to set the same up. LINK
docker run --rm -it -p 8000:80 -v c:\git\dotnet-docker\samples\aspnetapp:/app/ -w /app/aspnetapp microsoft/dotnet:2.1-sdk dotnet watch run
The sample project runs on port 80. No issues here.
But when I scaffold a project using dotnet cli the application would run on port 5000, 5001 inside the container instead of 80.
dotnet new webapi
What makes the sample app run on port 80? I compared the following files but not find anything helpful here.
- appsettings.Development.json
- appsettings.json
- aspnetapp.csproj
- Program.cs
- Startup.cs
Link to a GitHub for my code. LINK
Command on my project
docker run --rm -it -p 8000:80 -v c:\git\dotnet-docker-demo:/app/ -w /app microsoft/dotnet:2.1-sdk dotnet watch run
EDIT:
There is no docker file involved here. I am trying to use dotnet watch run directly on the source. I don't want to build dll and then run it in the container.