📦 build(docker): fix api publish in docker build

This commit is contained in:
2026-10-15 16:11:26 +03:30
parent f1b55db6d1
commit f185cf8a3f

View File

@@ -2,11 +2,15 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src WORKDIR /src
COPY . . COPY . .
RUN dotnet restore # Publish ONLY the API project: the build context contains the whole
RUN dotnet publish -c Release -o /app # 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 # مرحله runtime
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app WORKDIR /app
COPY --from=build /app . COPY --from=build /app .
EXPOSE 8080 EXPOSE 8080