Skip to content

Commit

Permalink
docker: revert all chanegs to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Jul 31, 2024
1 parent 3ebfc8d commit d4b0f7c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 15 deletions.
17 changes: 12 additions & 5 deletions Notesnook.API/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

WORKDIR /app

ADD . /app
# copy projects
COPY Streetwriters.Data/*.csproj ./Streetwriters.Data/
COPY Streetwriters.Common/*.csproj ./Streetwriters.Common/
COPY Notesnook.API/*.csproj ./Notesnook.API/

# restore all project dependencies
RUN dotnet restore -v d ./Notesnook.sln
# restore dependencies
RUN dotnet restore -v d /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/

WORKDIR /app/Notesnook.API/
# build
ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true"
RUN dotnet publish -c Release -o /app/out --self-contained false --no-restore /p:Runtimeidentifier=linux-x64
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:8.0
Expand Down
17 changes: 12 additions & 5 deletions Streetwriters.Identity/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

WORKDIR /app

ADD . /app
# copy projects
COPY Streetwriters.Data/*.csproj ./Streetwriters.Data/
COPY Streetwriters.Common/*.csproj ./Streetwriters.Common/
COPY Streetwriters.Identity/*.csproj ./Streetwriters.Identity/

# restore all project dependencies
RUN dotnet restore -v d ./Notesnook.sln
# restore dependencies
RUN dotnet restore -v d /app/Streetwriters.Identity/Streetwriters.Identity.csproj --use-current-runtime

# copy everything else
COPY Streetwriters.Data/ ./Streetwriters.Data/
COPY Streetwriters.Common/ ./Streetwriters.Common/
COPY Streetwriters.Identity/ ./Streetwriters.Identity/

WORKDIR /app/Streetwriters.Identity/
# build
ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true"
RUN dotnet publish -c Release -o /app/out --self-contained false --no-restore /p:Runtimeidentifier=linux-x64
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:8.0
Expand Down
17 changes: 12 additions & 5 deletions Streetwriters.Messenger/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

WORKDIR /app

ADD . /app
# copy projects
COPY Streetwriters.Data/*.csproj ./Streetwriters.Data/
COPY Streetwriters.Common/*.csproj ./Streetwriters.Common/
COPY Streetwriters.Messenger/*.csproj ./Streetwriters.Messenger/

# restore all project dependencies
RUN dotnet restore -v d ./Notesnook.sln
# restore dependencies
RUN dotnet restore -v d /app/Streetwriters.Messenger/Streetwriters.Messenger.csproj --use-current-runtime

# copy everything else
COPY Streetwriters.Data/ ./Streetwriters.Data/
COPY Streetwriters.Common/ ./Streetwriters.Common/
COPY Streetwriters.Messenger/ ./Streetwriters.Messenger/

WORKDIR /app/Streetwriters.Messenger/
# build
ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true"
RUN dotnet publish -c Release -o /app/out --self-contained false --no-restore /p:Runtimeidentifier=linux-x64
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:8.0
Expand Down

0 comments on commit d4b0f7c

Please sign in to comment.