Skip to content

Commit

Permalink
Just publish and implicitly restore and build
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoboss committed Oct 25, 2024
1 parent d7084ea commit 6775a99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 36 deletions.
13 changes: 1 addition & 12 deletions Backend/PubNet.API/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,12 @@ ARG BUILD_CONFIGURATION=Release

WORKDIR /src

COPY ["Directory.Build.props", "/"]
COPY ["Directory.Packages.props", "/"]
COPY ["Backend/PubNet.API/PubNet.API.csproj", "Backend/PubNet.API/"]

RUN dotnet restore "Backend/PubNet.API/PubNet.API.csproj"

COPY ../ .

WORKDIR "/src/Backend/PubNet.API"

RUN dotnet tool restore
RUN dotnet build "PubNet.API.csproj" -c $BUILD_CONFIGURATION -o /app/build

# git is only required for building
RUN rm -rf /src/.git && rm -rf /src/.gitignore

RUN dotnet publish "PubNet.API.csproj" --no-build --nologo -c $BUILD_CONFIGURATION -o /app/publish
RUN dotnet publish "PubNet.API.csproj" --nologo -c $BUILD_CONFIGURATION -o /app/publish

FROM base AS final
WORKDIR /app
Expand Down
13 changes: 1 addition & 12 deletions Frontend/PubNet.Client.Web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,12 @@ ARG BUILD_CONFIGURATION=Release

WORKDIR /src

COPY ["Directory.Build.props", "/"]
COPY ["Directory.Packages.props", "/"]
COPY ["Frontend/PubNet.Client.Web/PubNet.Client.Web.csproj", "Frontend/PubNet.Client.Web/"]

RUN dotnet restore "Frontend/PubNet.Client.Web/PubNet.Client.Web.csproj"

COPY ../ .

WORKDIR "/src/Frontend/PubNet.Client.Web"

RUN dotnet tool restore
RUN dotnet build "PubNet.Client.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build

# git is only required for building
RUN rm -rf /src/.git && rm -rf /src/.gitignore

RUN dotnet publish "PubNet.Client.Web.csproj" --no-build --nologo -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
RUN dotnet publish "PubNet.Client.Web.csproj" --nologo -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
Expand Down
13 changes: 1 addition & 12 deletions Worker/PubNet.Worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,12 @@ ARG BUILD_CONFIGURATION=Release

WORKDIR /src

COPY ["Directory.Build.props", "/"]
COPY ["Directory.Packages.props", "/"]
COPY ["Worker/PubNet.Worker/PubNet.Worker.csproj", "Worker/PubNet.Worker/"]

RUN dotnet restore "Worker/PubNet.Worker/PubNet.Worker.csproj"

COPY ../ .

WORKDIR "/src/Worker/PubNet.Worker"

RUN dotnet tool restore
RUN dotnet build "PubNet.Worker.csproj" -c $BUILD_CONFIGURATION -o /app/build

# git is only required for building
RUN rm -rf /src/.git && rm -rf /src/.gitignore

RUN dotnet publish "PubNet.Worker.csproj" --no-build --nologo -c $BUILD_CONFIGURATION -o /app/publish
RUN dotnet publish "PubNet.Worker.csproj" --nologo -c $BUILD_CONFIGURATION -o /app/publish

FROM base AS final

Expand Down

0 comments on commit 6775a99

Please sign in to comment.