Skip to content

Instantly share code, notes, and snippets.

@yaron-idan
Created May 6, 2019 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaron-idan/59e0f88cf7d15fa1e20045386a0e808d to your computer and use it in GitHub Desktop.
Save yaron-idan/59e0f88cf7d15fa1e20045386a0e808d to your computer and use it in GitHub Desktop.
dotnet core dockerfile
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