From 805ee02b4b59d4dbb562744db609353096cd6ec6 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 30 Jul 2024 16:06:18 +0500 Subject: [PATCH] fix docker build --- Notesnook.API/Dockerfile | 13 +++++++++---- Streetwriters.Identity/Dockerfile | 13 +++++++++---- Streetwriters.Messenger/Dockerfile | 13 +++++++++---- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Notesnook.API/Dockerfile b/Notesnook.API/Dockerfile index af6387b..7c34242 100644 --- a/Notesnook.API/Dockerfile +++ b/Notesnook.API/Dockerfile @@ -1,14 +1,19 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -# # restore all project dependencies -RUN dotnet restore -v d Notesnook.sln +WORKDIR /app + +ADD . /app + +# restore all project dependencies +RUN dotnet restore -v d ./Notesnook.sln # build ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true" -RUN dotnet publish /Notesnook.API/Notesnook.API.csproj -c Release -o /out --use-current-runtime --self-contained false --no-restore + +RUN dotnet publish ./Notesnook.API/Notesnook.API.csproj -c Release -o /app/out --use-current-runtime --self-contained false --no-restore # final stage/image FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app -COPY --from=build /out . +COPY --from=build /app/out . ENTRYPOINT ["dotnet", "Notesnook.API.dll"] \ No newline at end of file diff --git a/Streetwriters.Identity/Dockerfile b/Streetwriters.Identity/Dockerfile index 4263a07..f10159e 100644 --- a/Streetwriters.Identity/Dockerfile +++ b/Streetwriters.Identity/Dockerfile @@ -1,14 +1,19 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -# # restore all project dependencies -RUN dotnet restore -v d Notesnook.sln +WORKDIR /app + +ADD . /app + +# restore all project dependencies +RUN dotnet restore -v d ./Notesnook.sln # build ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true" -RUN dotnet publish /Streetwriters.Identity/Streetwriters.Identity.csproj -c Release -o /out --use-current-runtime --self-contained false --no-restore + +RUN dotnet publish ./Streetwriters.Identity/Streetwriters.Identity.csproj -c Release -o /app/out --use-current-runtime --self-contained false --no-restore # final stage/image FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app -COPY --from=build /out . +COPY --from=build /app/out . ENTRYPOINT ["dotnet", "Streetwriters.Identity.dll"] \ No newline at end of file diff --git a/Streetwriters.Messenger/Dockerfile b/Streetwriters.Messenger/Dockerfile index 5a47985..44226bf 100644 --- a/Streetwriters.Messenger/Dockerfile +++ b/Streetwriters.Messenger/Dockerfile @@ -1,14 +1,19 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -# # restore all project dependencies -RUN dotnet restore -v d Notesnook.sln +WORKDIR /app + +ADD . /app + +# restore all project dependencies +RUN dotnet restore -v d ./Notesnook.sln # build ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true" -RUN dotnet publish /Streetwriters.Messenger/Streetwriters.Messenger.csproj -c Release -o /out --use-current-runtime --self-contained false --no-restore + +RUN dotnet publish ./Streetwriters.Identity/Streetwriters.Messenger.csproj -c Release -o /app/out --use-current-runtime --self-contained false --no-restore # final stage/image FROM mcr.microsoft.com/dotnet/aspnet:8.0 WORKDIR /app -COPY --from=build /out . +COPY --from=build /app/out . ENTRYPOINT ["dotnet", "Streetwriters.Messenger.dll"] \ No newline at end of file