# 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 nginx:alpine # Copy the published Blazor app to nginx html directory COPY --from=build /app/publish/wwwroot /usr/share/nginx/html # Copy custom nginx configuration COPY nginx-blazor.conf /etc/nginx/conf.d/default.conf # Expose port 80 EXPOSE 80 # Start nginx CMD ["nginx", "-g", "daemon off;"]