Skip to content

Instantly share code, notes, and snippets.

@conectado
Created January 22, 2018 23:45
Show Gist options
  • Select an option

  • Save conectado/0db0c57b471f6492f52ac0e61e39cc29 to your computer and use it in GitHub Desktop.

Select an option

Save conectado/0db0c57b471f6492f52ac0e61e39cc29 to your computer and use it in GitHub Desktop.
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 . ./
#Build database
RUN dotnet ef database update
#Build project
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/yourComplaint.db .
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "yourComplaint.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment