From 4438a4d2488929b1b5e7c3b119018c42992099bb Mon Sep 17 00:00:00 2001 From: masoud Date: Fri, 5 Dec 2025 18:07:39 +0000 Subject: [PATCH] Fix Dockerfile for buildkit --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd2cc1d..43407b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /src -COPY src/*.sln ./ 2>/dev/null || true -COPY src/*/*.csproj ./ -RUN for file in *.csproj; do mkdir -p "${file%.*}" && mv "$file" "${file%.*}/"; done 2>/dev/null || true -RUN dotnet restore "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" || dotnet restore + +# Copy solution and project files COPY src/ ./ -RUN dotnet publish "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" -c Release -o /app/publish + +# Restore and publish +RUN dotnet restore "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" +RUN dotnet publish "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" -c Release -o /app/publish --no-restore FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime WORKDIR /app