Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tschissler authored Sep 18, 2023
1 parent b509b76 commit 489d717
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions TestService/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ USER app
WORKDIR /app
EXPOSE 8080

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
# Install clang/zlib1g-dev dependencies for publishing to native
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -15,16 +15,16 @@ ARG TARGETARCH
WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["TestService/TestService.csproj", "TestService/"]
RUN dotnet restore "TestService/TestService.csproj" -a $TARGETARCH
RUN dotnet restore "TestService/TestService.csproj"
COPY . .
WORKDIR "/src/TestService"
RUN dotnet build "TestService.csproj" -c $BUILD_CONFIGURATION -o /app/build -a $TARGETARCH
RUN dotnet build "TestService.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
RUN dotnet publish "TestService.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=true

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS final
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS final
WORKDIR /app
EXPOSE 8080
COPY --from=publish /app/publish .
ENTRYPOINT ["./TestService"]
ENTRYPOINT ["./TestService"]

0 comments on commit 489d717

Please sign in to comment.