From f185cf8a3ff3801929d5cfb34dde7792c0e7ccca Mon Sep 17 00:00:00 2001 From: alireza Date: Thu, 15 Oct 2026 16:11:26 +0330 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20build(docker):=20fix=20api=20pub?= =?UTF-8?q?lish=20in=20docker=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GreenHome.Api/Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/GreenHome.Api/Dockerfile b/src/GreenHome.Api/Dockerfile index 9d4561e..ce55d11 100644 --- a/src/GreenHome.Api/Dockerfile +++ b/src/GreenHome.Api/Dockerfile @@ -2,11 +2,15 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /src COPY . . -RUN dotnet restore -RUN dotnet publish -c Release -o /app - +# Publish ONLY the API project: the build context contains the whole +# solution, and publishing the sln would dump every project's +# appsettings.json into /app (last one wins) — e.g. DataCopy's +# overwrote the API's and broke IppanelSms startup. +RUN dotnet restore GreenHome.Api/GreenHome.Api.csproj +RUN dotnet publish GreenHome.Api/GreenHome.Api.csproj -c Release -o /app + # مرحله runtime -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime WORKDIR /app COPY --from=build /app . EXPOSE 8080