Created
June 14, 2018 00:57
-
-
Save richlander/8f58e5abecafdb727cd438ab799ec7f6 to your computer and use it in GitHub Desktop.
ASP.NET Web Forms Multi-stage build Dockerfile
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
FROM microsoft/dotnet-framework:4.7.2-sdk AS build | |
WORKDIR /app | |
# copy csproj and restore as distinct layers | |
COPY *.sln . | |
COPY aspnetapp/*.csproj ./aspnetapp/ | |
COPY aspnetapp/*.config ./aspnetapp/ | |
RUN nuget restore | |
# copy everything else and build app | |
COPY aspnetapp/. ./aspnetapp/ | |
WORKDIR /app/aspnetapp | |
RUN msbuild /p:Configuration=Release | |
# copy build artifacts into runtime image | |
FROM microsoft/aspnet:4.7.2 AS runtime | |
WORKDIR /inetpub/wwwroot | |
COPY --from=build /app/aspnetapp/. ./ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment