fix: Revert to aspnet runtime - FrontOffice is Blazor Server not WASM
All checks were successful
Build and Deploy / build (push) Successful in 1m42s

- Project uses Microsoft.NET.Sdk.Web (Blazor Server)
- Not Microsoft.NET.Sdk.BlazorWebAssembly
- Needs aspnet runtime to run the .dll, not nginx for static files
- Changed back from nginx:alpine to aspnet:9.0
This commit is contained in:
masoud
2025-12-07 23:35:09 +00:00
parent 380b4788dd
commit 3c528aba48

View File

@@ -15,24 +15,12 @@ COPY . .
WORKDIR "/src/FrontOffice.Main"
RUN dotnet publish "FrontOffice.Main.csproj" -c Release -o /app/publish
# Runtime stage - nginx for Blazor WebAssembly
FROM nginx:alpine AS final
WORKDIR /usr/share/nginx/html
# Remove default nginx files
RUN rm -rf /usr/share/nginx/html/*
# Copy published wwwroot (Blazor WASM output)
COPY --from=build /app/publish/wwwroot .
# Configure nginx for SPA routing
RUN echo 'server { \
listen 80; \
server_name _; \
location / { \
root /usr/share/nginx/html; \
try_files $uri $uri/ /index.html; \
} \
}' > /etc/nginx/conf.d/default.conf
# Runtime stage - aspnet for Blazor Server
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish .
ENV ASPNETCORE_URLS=http://+:80
EXPOSE 80
ENTRYPOINT ["dotnet", "FrontOffice.Main.dll"]