Last active
February 13, 2018 22:06
-
-
Save karlospn/96d67bda7bcace0777ee5c535c977f3a to your computer and use it in GitHub Desktop.
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/aspnetcore-build:2.0 AS build-env | |
WORKDIR /app | |
EXPOSE 80 | |
# Copy csproj and restore as distinct layers | |
COPY *.sln ./ | |
COPY DockerBlankApiTest/*.csproj DockerBlankApiTest/ | |
RUN dotnet restore | |
# Copy everything else and build | |
COPY . ./ | |
RUN dotnet publish DockerBlankApiTest/*.csproj -c Release -o out | |
# Build runtime image | |
FROM microsoft/aspnetcore:2.0 | |
COPY DockerBlankApiTest/to_copy to_copy | |
WORKDIR /app | |
COPY --from=build-env /app/DockerBlankApiTest/out . | |
ENTRYPOINT ["dotnet", "DockerBlankApiTest.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment