Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

docker file for blazor web app with per component interactivity

$
0
0

I have a solution with some projects like an WPF app, a .net class library and a console program. I have just added a new Blazor project. I chose the "Blazor Web App" with interactivity WebAssembly and location per component. The template generated a two projects. One with the name I gave, and one with the "Client" suffix.When I hit play in Visual Studio it does everything from compile to starting the host and opening my browser so that I see the beautiful "Hello World" site.

Now I want to host this app in docker on a linux machine.

For this I wrote this docker file:

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS buildCOPY . .RUN dotnet restore PvPower.WebApp/PvPower.WebApp/PvPower.WebApp.csprojRUN dotnet restore PvPower.WebApp/PvPower.WebApp.Client/PvPower.WebApp.Client.csprojRUN dotnet publish PvPower.WebApp/PvPower.WebApp/PvPower.WebApp.csproj -c release --no-restoreFROM mcr.microsoft.com/dotnet/aspnet:8.0COPY --from=build PvPower.WebApp PvPower.WebAppCOPY --from=build PvPowerReader.sln PvPowerReader.slnENTRYPOINT ["dotnet", "run --project PvPower.WebApp/PvPower.WebApp/PvPower.WebApp.csproj --no-build -c release"]

But I get the following error message:

The command could not be loaded, possibly because:  * You intended to execute a .NET application:      The application 'run --project PvPower.WebApp/PvPower.WebApp/PvPower.WebApp.csproj --no-build -c release' does not exist.  * You intended to execute a .NET SDK command:      No .NET SDKs were found.Download a .NET SDK:https://aka.ms/dotnet/downloadLearn about SDK resolution:https://aka.ms/dotnet/sdk-not-found

The error is pretty straight forward: dotnet run is not available in the aspnet-image I chose. But I don't want to use the fat (800MB) sdk-image, because I read somewhere that I could use nginx:alpine with just 5MB footprint.

But the reason I am using dotnet run is, that with the command dotnet PvPower.WebApp\PvPower.WebApp\bin\Debug\net8.0\PvPower.WebApp.dll I just get this site, where it seems that something is missing.BareSite

So my ultimate goal is to get a docker file to run my web app. But I would also like to understand why dotnet PvPower.WebApp\PvPower.WebApp\bin\Debug\net8.0\PvPower.WebApp.dll does not work.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>