The Blazor Web App requires the ASP.NET runtime to function properly, as it uses interactive server components. Changed from nginx serving static files to running the full .NET application. Changes: - Updated Dockerfile to use aspnet:9.0 runtime image - Removed nginx configuration (no longer needed) - Disabled HTTPS redirection (running behind reverse proxy) - Added publish/ folder to .gitignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
731 B
Docker
31 lines
731 B
Docker
# Build stage
|
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|
WORKDIR /src
|
|
|
|
# Copy project file and restore dependencies
|
|
COPY BlazorApp/SilverLabs.Website.csproj BlazorApp/
|
|
RUN dotnet restore "BlazorApp/SilverLabs.Website.csproj"
|
|
|
|
# Copy all source files
|
|
COPY BlazorApp/ BlazorApp/
|
|
|
|
# Build and publish the application
|
|
WORKDIR /src/BlazorApp
|
|
RUN dotnet publish "SilverLabs.Website.csproj" -c Release -o /app/publish
|
|
|
|
# Runtime stage
|
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
|
|
|
WORKDIR /app
|
|
COPY --from=build /app/publish .
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Set environment to production
|
|
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
ENV ASPNETCORE_URLS=http://+:80
|
|
|
|
# Start the Blazor application
|
|
ENTRYPOINT ["dotnet", "SilverLabs.Website.dll"]
|