Files
telegram-bot/Dockerfile
T

39 lines
1.4 KiB
Docker
Raw Normal View History

2022-01-10 01:01:38 +02:00
# Build a project
FROM mcr.microsoft.com/dotnet/sdk:6.0.101-alpine3.14 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/Destiny2.WhereIsXur/*.csproj ./modules/Destiny2.WhereIsXur/
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/ChatQuotes/*.csproj ./modules/ChatQuotes/
COPY ./modules/Reputation/*.csproj ./modules/Reputation/
COPY ./modules/ContentStore/*.csproj ./modules/ContentStore/
2022-01-10 01:01:38 +02:00
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
2022-01-10 01:05:02 +02:00
FROM mcr.microsoft.com/dotnet/aspnet:6.0.1-alpine3.14
2022-01-10 01:01:38 +02:00
WORKDIR /user
COPY --from=build /app /app
2022-02-16 20:05:14 +03:00
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
Logging__Console__FormatterName=Simple
2022-01-10 01:01:38 +02:00
2022-02-16 20:05:14 +03:00
RUN apk add --no-cache icu-libs
2022-01-10 01:01:38 +02:00
ENTRYPOINT ["dotnet", "/app/TelegramBot.dll"]