fix docker build

This commit is contained in:
Abdullah Atta
2024-07-30 16:06:18 +05:00
parent e808d28c45
commit 805ee02b4b
3 changed files with 27 additions and 12 deletions

View File

@@ -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"]