Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeleedev committed Oct 27, 2023
1 parent 07edf72 commit 4ae6701
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /App
WORKDIR /TodoApi

# Copy everything
COPY . ./TodoApi
# Restore as distinct layers
COPY . ./
RUN dotnet restore
# Build and publish a release
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /App
WORKDIR /TodoApi
COPY --from=build-env /App/out .
ENTRYPOINT ["dotnet", "TodoApi.dll"]

0 comments on commit 4ae6701

Please sign in to comment.