Skip to content

Commit

Permalink
fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Jul 30, 2024
1 parent e808d28 commit 805ee02
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
13 changes: 9 additions & 4 deletions Notesnook.API/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
13 changes: 9 additions & 4 deletions Streetwriters.Identity/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
13 changes: 9 additions & 4 deletions Streetwriters.Messenger/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 805ee02

Please sign in to comment.