mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
28 lines
1.1 KiB
Docker
28 lines
1.1 KiB
Docker
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
|
WORKDIR /app
|
|
|
|
# restore all project dependencies
|
|
COPY Streetwriters.Data/*.csproj ./Streetwriters.Data/
|
|
RUN dotnet restore /app/Streetwriters.Data/Streetwriters.Data.csproj --use-current-runtime
|
|
|
|
COPY Streetwriters.Common/*.csproj ./Streetwriters.Common/
|
|
RUN dotnet restore /app/Streetwriters.Common/Streetwriters.Common.csproj --use-current-runtime
|
|
|
|
COPY Notesnook.API/*.csproj ./Notesnook.API/
|
|
RUN dotnet restore /app/Notesnook.API/Notesnook.API.csproj --use-current-runtime
|
|
|
|
# copy everything else
|
|
COPY Streetwriters.Data/ ./Streetwriters.Data/
|
|
COPY Streetwriters.Common/ ./Streetwriters.Common/
|
|
COPY Notesnook.API/ ./Notesnook.API/
|
|
|
|
# build
|
|
WORKDIR /app/Notesnook.API/
|
|
ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true"
|
|
RUN dotnet publish -c Release -o /app/out --use-current-runtime --self-contained false --no-restore
|
|
|
|
# final stage/image
|
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
|
WORKDIR /app
|
|
COPY --from=build /app/out .
|
|
ENTRYPOINT ["dotnet", "Notesnook.API.dll"] |