Im trying to create a container that contains a IIS which hosts my blazor applications.
I got it all running with static HTML files but when I try to host a blazor app im getting the error in the browser:
You do not have permission to view this directory or page.
or
The page cannot be displayed because an internal server error has occurred.
When I restart the container and look up the logs i get the following:
Service 'w3svc' has been stopped
APPCMD failed with error code 4312
Failed to update IIS configuration
When I use a workaround with creating my own entrypoint and starting w3svc
i'm stuck in a endless loop.
My current dockerfile
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-20191210-windowsservercore-ltsc2019
COPY ./dotnet/dotnet-hosting-3.1.0-win.exe .
RUN powershell ./dotnet-hosting-3.1.0-win.exe /quiet /install
RUN powershell -NoProfile -Command Remove-Item -Recurse C:\inetpub\wwwroot\*
WORKDIR /inetpub/wwwroot
COPY ./output . # Contains compiled blazor hello world project
COPY ./config.ps1 .
RUN powershell ./config.ps1 # Creates new app and pool
COPY ./ContainerRunTime.ps1 .
ENTRYPOINT ./ContainerRunTime.ps1 # C:\\ServiceMonitor.exe w3svc
My OS is WinServer 2019