Files
Andriy 8917a8ba5f chore: drop unused modules
These two are making lots of problems during update process: the `ChatQuotes` one was never operational and the `Destiny2.WhereIsXur` became obsolete, since Xur was granted his permanent place on the Tower
2025-02-09 15:47:57 +02:00

40 lines
1.5 KiB
Docker

# Build a project
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
WORKDIR /source
# Copy project and perform restoring
COPY Kruzya.TelegramBot.sln ./
COPY ./Core/*.csproj ./Core/
COPY ./tests/*.csproj ./tests/
COPY ./modules/CombotAntiSpam/*.csproj ./modules/CombotAntiSpam/
COPY ./modules/RichSiteSummary/*.csproj ./modules/RichSiteSummary/
COPY ./modules/UrlLimitations/*.csproj ./modules/UrlLimitations/
COPY ./modules/ChatManagement/*.csproj ./modules/ChatManagement/
COPY ./modules/Entertainment/*.csproj ./modules/Entertainment/
COPY ./modules/UserGroupTag/*.csproj ./modules/UserGroupTag/
COPY ./modules/Reputation/*.csproj ./modules/Reputation/
COPY ./modules/ContentStore/*.csproj ./modules/ContentStore/
COPY ./modules/DebugTools/*.csproj ./modules/DebugTools/
COPY ./modules/CodeWatcher/*.csproj ./modules/CodeWatcher/
COPY ./modules/StickerTools/*.csproj ./modules/StickerTools/
RUN dotnet restore Kruzya.TelegramBot.sln
# Copy all project files
COPY . .
RUN dotnet publish -c release -o /app --no-restore Kruzya.TelegramBot.sln && \
mkdir /app/modules && \
cp /app/TelegramBot.*.dll /app/modules/ && \
rm -f /app/TelegramBot.*.dll /app/TelegramBot.*.pdb
# Now reuse image with only runtime
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
WORKDIR /user
COPY --from=build /app /app
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
Logging__Console__FormatterName=Simple
RUN apk add --no-cache icu-libs
ENTRYPOINT ["dotnet", "/app/TelegramBot.dll"]