Skip to content

Instantly share code, notes, and snippets.

@screamingworld
Last active February 28, 2021 22:04
Show Gist options
  • Save screamingworld/621a77f96b17b6c6811b589f76726e59 to your computer and use it in GitHub Desktop.
Save screamingworld/621a77f96b17b6c6811b589f76726e59 to your computer and use it in GitHub Desktop.
Notifier Web Api - Dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["./WebApi/Notifier.WebApi/Notifier.WebApi.csproj", "src/WebApi/Notifier.WebApi/"]
COPY ["./Common/Notifier.Common/Notifier.Common.csproj", "src/Common/Notifier.Common/"]
RUN dotnet restore "src/WebApi/Notifier.WebApi/Notifier.WebApi.csproj"
COPY . .
WORKDIR "/src/WebApi/Notifier.WebApi"
RUN dotnet build "Notifier.WebApi.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Notifier.WebApi.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Notifier.WebApi.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment