From 2aca48738f6dee2fa4e646c66eb12224adec9588 Mon Sep 17 00:00:00 2001 From: alireza Date: Thu, 3 Sep 2026 09:09:36 +0330 Subject: [PATCH] fix dockerfile build error --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index a19e724..f07bbda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,15 +6,16 @@ RUN apt-get update && apt-get install -y nodejs npm python3 make g++ && rm -rf / COPY ./src/ . -# Install frontend dependencies before dotnet build -RUN npm install --prefix ./GreenHome.Web +# Use npm ci for clean install based on package-lock.json +RUN cd ./GreenHome.Web && \ + npm ci RUN dotnet restore --verbosity detailed -RUN dotnet publish -c Release -o /app +RUN dotnet publish -c Release -o /app FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime WORKDIR /app COPY --from=build /app . RUN mkdir -p /app/My_StaticFiles RUN mkdir -p /app/files -ENTRYPOINT ["dotnet", "GreenHome.Api.dll"] +ENTRYPOINT ["dotnet", "GreenHome.Api.dll"] \ No newline at end of file