Skip to content

Commit

Permalink
Set workdir to subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
Joefficial committed May 16, 2021
1 parent 4bcdd53 commit 0fc6f07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions RestApiExample/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["RestApiExample/RestApiExample.csproj", "./RestApiExample"]
RUN dotnet restore "RestApiExample/RestApiExample.csproj"
WORKDIR /src/RestApiExample
COPY ["RestApiExample.csproj", "./"]
RUN dotnet restore "RestApiExample.csproj"
COPY . .
RUN dotnet publish "RestApiExample/RestApiExample.csproj" -c Release -o /app/publish
RUN dotnet publish "RestApiExample.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "RestApiExample/RestApiExample.dll"]
ENTRYPOINT ["dotnet", "RestApiExample.dll"]

0 comments on commit 0fc6f07

Please sign in to comment.