Skip to content

Instantly share code, notes, and snippets.

@g33kChris
Created September 11, 2018 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g33kChris/6311c2d82dc1ab413305abf81f66ecd1 to your computer and use it in GitHub Desktop.
Save g33kChris/6311c2d82dc1ab413305abf81f66ecd1 to your computer and use it in GitHub Desktop.
.net api dockerfile
FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
EXPOSE 80
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "g33kchris.video.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment