PluralKit/Dockerfile

35 lines
1.1 KiB
Docker
Raw Normal View History

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
2022-04-10 14:57:51 +00:00
2019-08-12 04:49:18 +00:00
WORKDIR /app
2020-08-25 18:37:31 +00:00
# Restore/fetch dependencies excluding app code to make use of caching
2021-09-27 22:11:31 +00:00
COPY PluralKit.sln /app/
2021-03-03 22:27:54 +00:00
COPY Myriad/Myriad.csproj /app/Myriad/
2020-08-25 18:37:31 +00: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/
COPY PluralKit.ScheduledTasks/PluralKit.ScheduledTasks.csproj /app/PluralKit.ScheduledTasks/
2020-08-25 18:37:31 +00:00
COPY PluralKit.Tests/PluralKit.Tests.csproj /app/PluralKit.Tests/
COPY .git/ /app/.git
2022-01-23 06:52:41 +00:00
COPY proto/ /app/proto
2020-08-25 18:37:31 +00: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 04:49:18 +00:00
# Build runtime stage (doesn't include SDK)
FROM mcr.microsoft.com/dotnet/aspnet:6.0
2022-06-05 16:57:10 +00:00
LABEL org.opencontainers.image.source = "https://github.com/PluralKit/PluralKit"
WORKDIR /app
COPY --from=build /app ./
2022-04-10 14:57:51 +00:00
# Runtime dependency in prod
RUN apt update && apt install -y curl
ADD scripts/run-clustered.sh /
2020-08-25 18:37:31 +00:00
# Allow overriding CMD from eg. docker-compose to run API layer too
ENTRYPOINT ["dotnet"]
2021-09-27 22:11:31 +00:00
CMD ["bin/PluralKit.Bot.dll"]