Created
September 15, 2019 15:30
-
-
Save SaurabhLpRocks/44c50714a37bc138eae06e4386cfddc8 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
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed. | |
#For more information, please see https://aka.ms/containercompat | |
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base | |
WORKDIR /app | |
EXPOSE 80 | |
EXPOSE 443 | |
FROM microsoft/dotnet:2.2-sdk AS build | |
WORKDIR /src | |
COPY ["CoreApi.csproj", "CoreApi.csproj"] | |
RUN dotnet restore "CoreApi.csproj" | |
COPY . . | |
RUN dotnet build "CoreApi.csproj" -c Release -o /app | |
FROM build AS publish | |
RUN dotnet publish "CoreApi.csproj" -c Release -o /app | |
FROM base AS final | |
WORKDIR /app | |
COPY --from=publish /app . | |
ENTRYPOINT ["dotnet", "CoreApi.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment