blazor-workshop icon indicating copy to clipboard operation
blazor-workshop copied to clipboard

please include docker with nginx example

Open rclarke2050 opened this issue 5 years ago • 4 comments

please could you include a docker image behind nginx of both a blazor webassembly and a blazor server app. That would be very helpful for those of us using containers either through azure/aws/k8s.

thanks

rclarke2050 avatar Apr 20 '20 11:04 rclarke2050

@rclarke2050 can you elaborate more on nginx of both a blazor web assembly & a blazor server app?

From my understanding - the hosting model showcased for the Blazor WASM app in the workshop is that of what we call ASP.NET Core Hosted. What it means is, the BlazingPizza.Server is going to be serving the static assets. The static assets in our case are the Blazor WASM app(or BlazingPizza.Client). So you could just create a docker image out of BlazingPizza.Server.

Are you suggesting that this workshop be enhanced to include a Docker file out of the box?

lohithgn avatar Apr 16 '21 09:04 lohithgn

@rclarke2050 if you are using Visual Studio 2019 on Windows, you can install an extension called VS Tools for Docker https://docs.microsoft.com/en-us/dotnet/architecture/containerized-lifecycle/design-develop-containerized-apps/visual-studio-tools-for-docker. After this right click on BlazingPizza.Server project in your solution explorer, select Add > Docker Support. This will generate a Dockerfile for you. And if you have installed Docker Desktop - VS will create a Docker profile for BlazingPizza.Server project. Just run that profile - it will build the docker file, generate the image locally and run it in a container. You can watch the container within VS itself. Here is what it looks in my machine: image

lohithgn avatar Apr 16 '21 09:04 lohithgn

@rclarke2050 did you get a chance to check my responses above. If this is no longer an issue for you, do consider closing this issue. Thanks.

lohithgn avatar Dec 20 '21 10:12 lohithgn

I find that when I try to run this in a dockerfile, that I can't get it to run because IdentityServer wants a license key. Adding this environment variable seems to help with that:

ENV ASPNETCORE_ENVIRONMENT=Development

RobCannon avatar May 14 '22 18:05 RobCannon