Created
March 25, 2020 17:05
-
-
Save georgboe/01e5afb7c395fb0f649223763ce11be3 to your computer and use it in GitHub Desktop.
Dockerfile for ASP.NET Core projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stage 1 | |
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build | |
WORKDIR /build | |
COPY . . | |
RUN dotnet restore | |
RUN dotnet publish -c Release \ | |
-o /app \ | |
-r linux-musl-x64 \ | |
--self-contained true \ | |
-p:PublishSingleFile=true \ | |
-p:PublishTrimmed=true | |
# Stage 2 | |
FROM mcr.microsoft.com/dotnet/core-nightly/runtime-deps:3.1-alpine AS final | |
WORKDIR /app | |
COPY --from=build /app . | |
ENTRYPOINT ["/app/webapptest2"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment