PluralKit/Dockerfile
Ske 6a3d9b9426 Revert Dockerfile to multi-stage build
Signed-off-by: Ske <voltasalt@gmail.com>
2021-06-09 12:47:26 +02:00

24 lines
822 B
Docker

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /app
# Restore/fetch dependencies excluding app code to make use of caching
COPY PluralKit.sln nuget.config /app/
COPY Myriad/Myriad.csproj /app/Myriad/
COPY PluralKit.API/PluralKit.API.csproj /app/PluralKit.API/
COPY PluralKit.Bot/PluralKit.Bot.csproj /app/PluralKit.Bot/
COPY PluralKit.Core/PluralKit.Core.csproj /app/PluralKit.Core/
COPY PluralKit.Tests/PluralKit.Tests.csproj /app/PluralKit.Tests/
RUN dotnet restore PluralKit.sln
# Copy the rest of the code and build
COPY . /app
RUN dotnet build -c Release -o bin
# 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"]