Skip to content

Instantly share code, notes, and snippets.

@ahelland
Created April 18, 2018 08:06
Show Gist options
  • Save ahelland/2e6ca83e675e2c0d286c312a255dc6c7 to your computer and use it in GitHub Desktop.
Save ahelland/2e6ca83e675e2c0d286c312a255dc6c7 to your computer and use it in GitHub Desktop.
Dockerfile for api-playground referred to in "Building Microservices with AKS and VSTS — Part 4"
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
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "API-Playground.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment