Skip to content

Instantly share code, notes, and snippets.

@mehmetcantas
Last active June 20, 2020 18:35
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 mehmetcantas/a2949b02c7571de8d545fbae566191ed to your computer and use it in GitHub Desktop.
Save mehmetcantas/a2949b02c7571de8d545fbae566191ed to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY . .
WORKDIR "./src/Sample.Api"
RUN dotnet build "Sample.Api.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "Sample.Api.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Sample.Api.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment