mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
45 lines
1.7 KiB
Docker
45 lines
1.7 KiB
Docker
# 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/
|
|
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:6.0.1-alpine3.14
|
|
WORKDIR /user
|
|
COPY --from=build /app /app
|
|
|
|
ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
|
|
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
|
|
|
|
RUN apk add --no-cache cmake make musl-dev gcc gettext-dev libintl icu-libs \
|
|
&& wget https://gitlab.com/rilian-la-te/musl-locales/-/archive/master/musl-locales-master.zip \
|
|
&& unzip musl-locales-master.zip \
|
|
&& cd musl-locales-master \
|
|
&& cmake -DLOCALE_PROFILE=OFF -D CMAKE_INSTALL_PREFIX:PATH=/usr . && make && make install \
|
|
&& cd .. && rm -r musl-locales-master
|
|
|
|
ENV LANG ru_RU.UTF-8
|
|
ENV LANGUAGE ru_RU.UTF-8
|
|
ENV LC_ALL ru_RU.UTF-8
|
|
|
|
ENTRYPOINT ["dotnet", "/app/TelegramBot.dll"]
|