Created
May 6, 2019 21:23
-
-
Save yaron-idan/59e0f88cf7d15fa1e20045386a0e808d to your computer and use it in GitHub Desktop.
dotnet core 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:2.1-aspnetcore-runtime AS base | |
WORKDIR /app | |
EXPOSE 80 | |
EXPOSE 443 | |
EXPOSE 5000 | |
FROM microsoft/dotnet:2.1-sdk AS build | |
WORKDIR /src | |
COPY ["TestAPI.csproj", "."] | |
RUN dotnet restore "TestAPI.csproj" | |
COPY . . | |
#WORKDIR "/src/TestAPI" | |
RUN dotnet build "TestAPI.csproj" -c Release -o /app | |
FROM build AS publish | |
RUN dotnet publish "TestAPI.csproj" -c Release -o /app | |
FROM base AS final | |
WORKDIR /app | |
COPY --from=publish /app . | |
ENTRYPOINT ["dotnet", "TestAPI.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment