An example of an app generated with yo aspnetcore-spa
and a slightly modified
Dockerfile to use the donet publish
dll rather than dotnet run
.
These were the commands to setup the repo as described in aspnet/JavaScriptServices and blog.stevensanderson.com.
npm install -g yo generator-aspnetcore-spa
npm install -g webpack
yo aspnetcore-spa
export ASPNETCORE_ENVIRONMENT=Production
See this commit.
To publish the app run:
dotnet restore
dotnet publish -r debian.8-x64 -c release
To try to run app in docker container:
docker build -t aspnetcorespa .
docker run -p 80:5000 aspnetcorespa
To connect to the docker container assuming using default machine:
curl http://$(docker-machine ip default)
Or open your favorite web browser and connect to the ip address from
docker-machine ip default