From 6a3d9b9426a6b68cdbf88cc32d14ffc3dd6004b3 Mon Sep 17 00:00:00 2001 From: Ske Date: Wed, 9 Jun 2021 12:47:26 +0200 Subject: [PATCH] Revert Dockerfile to multi-stage build Signed-off-by: Ske --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b1a2284..44d017c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:5.0 +FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build WORKDIR /app # Restore/fetch dependencies excluding app code to make use of caching @@ -14,7 +14,11 @@ RUN dotnet restore PluralKit.sln COPY . /app RUN dotnet build -c Release -o bin -# Run :) +# Build runtime stage (doesn't include SDK) +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +WORKDIR /app +COPY --from=build /app ./ + # Allow overriding CMD from eg. docker-compose to run API layer too ENTRYPOINT ["dotnet"] CMD ["bin/PluralKit.Bot.dll"] \ No newline at end of file