diff --git a/.gitignore b/.gitignore index ba39fdc..2df1779 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,9 @@ bld/ # Backup folder old-static-site/ +# Publish output +publish/ + # OS Files .DS_Store Thumbs.db diff --git a/BlazorApp/Program.cs b/BlazorApp/Program.cs index 25fc569..138807b 100644 --- a/BlazorApp/Program.cs +++ b/BlazorApp/Program.cs @@ -16,8 +16,7 @@ if (!app.Environment.IsDevelopment()) app.UseHsts(); } -app.UseHttpsRedirection(); - +// app.UseHttpsRedirection(); // Disabled - running behind reverse proxy app.UseAntiforgery(); diff --git a/Dockerfile b/Dockerfile index 2540884..cb14491 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,16 +14,17 @@ WORKDIR /src/BlazorApp RUN dotnet publish "SilverLabs.Website.csproj" -c Release -o /app/publish # Runtime stage -FROM nginx:alpine +FROM mcr.microsoft.com/dotnet/aspnet:9.0 -# 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 +WORKDIR /app +COPY --from=build /app/publish . # Expose port 80 EXPOSE 80 -# Start nginx -CMD ["nginx", "-g", "daemon off;"] +# Set environment to production +ENV ASPNETCORE_ENVIRONMENT=Production +ENV ASPNETCORE_URLS=http://+:80 + +# Start the Blazor application +ENTRYPOINT ["dotnet", "SilverLabs.Website.dll"]