Files
telegram-bot/docker/Dockerfile.aarch64
T

43 lines
1.6 KiB
Docker
Raw Normal View History

2021-12-21 23:49:15 +04:00
# Build a project
2021-12-25 20:08:40 +04:00
FROM mcr.microsoft.com/dotnet/sdk:5.0.404-buster-slim-arm64v8 AS build
2021-12-21 23:49:15 +04:00
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/
2021-12-26 17:47:02 +04:00
COPY ./modules/ChatManagement/*.csproj ./modules/ChatManagement/
2022-01-02 21:56:14 +02:00
COPY ./modules/Entertainment/*.csproj ./modules/Entertainment/
2021-12-21 23:49:15 +04: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/ && \
2022-01-02 22:13:11 +02:00
rm -f /app/TelegramBot.*.dll /app/TelegramBot.*.pdb
2021-12-21 23:49:15 +04:00
# Now reuse image with only runtime
2021-12-25 20:08:40 +04:00
FROM mcr.microsoft.com/dotnet/aspnet:5.0.13-alpine3.14-arm64v8
2021-12-21 23:49:15 +04:00
WORKDIR /user
COPY --from=build /app /app
ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
RUN apk add --no-cache cmake make musl-dev gcc gettext-dev libintl \
&& 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
2021-12-21 23:49:15 +04:00
ENTRYPOINT ["dotnet", "/app/TelegramBot.dll"]