2021-11-26 22:24:24 -05:00
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
2019-08-12 06:49:18 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-08-25 20:37:31 +02:00
|
|
|
# Restore/fetch dependencies excluding app code to make use of caching
|
2021-09-27 18:11:31 -04:00
|
|
|
COPY PluralKit.sln /app/
|
2021-03-03 23:27:54 +01:00
|
|
|
COPY Myriad/Myriad.csproj /app/Myriad/
|
2020-08-25 20:37:31 +02:00
|
|
|
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/
|
2021-10-15 06:27:38 -04:00
|
|
|
COPY PluralKit.ScheduledTasks/PluralKit.ScheduledTasks.csproj /app/PluralKit.ScheduledTasks/
|
2020-08-25 20:37:31 +02:00
|
|
|
COPY PluralKit.Tests/PluralKit.Tests.csproj /app/PluralKit.Tests/
|
2021-08-01 15:22:23 -04:00
|
|
|
COPY .git/ /app/.git
|
2022-01-23 01:52:41 -05:00
|
|
|
COPY proto/ /app/proto
|
2020-08-25 20:37:31 +02:00
|
|
|
RUN dotnet restore PluralKit.sln
|
|
|
|
|
|
|
|
# Copy the rest of the code and build
|
|
|
|
COPY . /app
|
|
|
|
RUN dotnet build -c Release -o bin
|
2019-08-12 06:49:18 +02:00
|
|
|
|
2021-06-09 12:47:26 +02:00
|
|
|
# Build runtime stage (doesn't include SDK)
|
2021-11-26 22:24:24 -05:00
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
2021-06-09 12:55:38 +02:00
|
|
|
LABEL org.opencontainers.image.source = "https://github.com/xSke/PluralKit"
|
|
|
|
|
2021-06-09 12:47:26 +02:00
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /app ./
|
|
|
|
|
2020-08-25 20:37:31 +02:00
|
|
|
# Allow overriding CMD from eg. docker-compose to run API layer too
|
|
|
|
ENTRYPOINT ["dotnet"]
|
2021-09-27 18:11:31 -04:00
|
|
|
CMD ["bin/PluralKit.Bot.dll"]
|