Skip to content

Instantly share code, notes, and snippets.

@screamingworld

screamingworld/Dockerfile

Last active Feb 28, 2021
Embed
What would you like to do?
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