Blazor template in release configuration no access to content of wwwroot folder

Hello dear support team,

I use the default Blazor template from ApolloX and build it in release configuration and deploy it to my Apalis iMX6Q 1GB V1.1D. I used following commands in terminal of distro (Ubuntu 22.4) in VSCode:

docker compose build --pull --build-arg IMAGE_ARCH=arm
docker compose push testblazorapp
docker compose up -d

The container is running after docker compose up, but when I call the webpage I get this output in my webbrowser:

When I open dev-tools I get this:

It looks like, that the content of wwwroot folder is not available, but when I login to shell of docker container I can see that folder and its content:

Do you know what this could be? Thanks in advance!

Hello everyone,

I made it on my own. I changed the Dockerfile to the way like Microsoft do, when creating a blazor server project with visual studio 2022 and activating docker support. I just customize the first lines of the Dockerfile template to change the base aspdotnet image to your image ā€œtorizon/aspdotnetā€.

This is what IĀ“ve done:

FROM --platform=linux/arm/v7 torizon/aspdotnet:3-6.0 AS base
RUN apt-get -y update && apt-get install -y --no-install-recommends && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
WORKDIR /app
EXPOSE 8080

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY [ā€œtesttorizonblazor/testtorizonblazor.csprojā€, ā€œtesttorizonblazor/ā€]
RUN dotnet restore ā€œtesttorizonblazor/testtorizonblazor.csprojā€
COPY . .
WORKDIR ā€œ/src/testtorizonblazorā€
RUN dotnet build ā€œtesttorizonblazor.csprojā€ -c Release -o /app/build

FROM build AS publish
RUN dotnet publish ā€œtesttorizonblazor.csprojā€ -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT [ā€œdotnetā€, ā€œtesttorizonblazor.dllā€]

After that I just need to execute ā€œdocker compose up -dā€ and everything is working fine in web browser.
Have a nice evening!

1 Like

Glad to hear you were able to solve the issue!