Refactored dockerfile base and final images

This commit is contained in:
2026-07-14 11:25:59 +02:00
parent 32daf00f24
commit bf48ba5d18
+2 -2
View File
@@ -1,5 +1,5 @@
# Stage 1: Build environment
FROM mcr.microsoft.com/dotnet/sdk:10.0-bookworm-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
# 1. Explicitly run as root for the build stage
USER root
WORKDIR /src
@@ -17,7 +17,7 @@ RUN dotnet build "LiteCharmsMessaging.csproj" -c Release -o /app/build
RUN dotnet publish "LiteCharmsMessaging.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Stage 2: Runtime environment
FROM mcr.microsoft.com/dotnet/aspnet:10.0-bookworm-slim AS final
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
# 2. Switch to the built-in non-root user ('app') before copying files