In order to get familiar with razor pages and asp.net core apps, I've followed this tutorial, which was also very nicely done by Scott Hanselmann and Maira Wenzel in this video session .
I've extended this app to be run from inside a docker container, as in this example for creating and running docker images for asp.net core.
Simply run the app with dotnet run
.
Run the app with hot reload by typing dotnet watch
.
The Dockerfile
specifies to build and run the app on top of the dotnet sdk docker image.
Build and launch the docker container by typing
docker build -t razorpagespizza .
docker run -it -p 5000:80 razorpagespizza
This -p 5000:80
maps the container's port 80 to your localhost's port 5000.
Finally you can access the website on localhost:5000
.