Files
docker-tg-bot-api/build/Dockerfile
Dmitry 46ad589909
All checks were successful
Docker Image CI / test (push) Successful in 34m23s
Docker Image CI / push (push) Successful in 34m0s
fix config
2026-04-15 12:58:49 +03:00

59 lines
1.2 KiB
Docker

FROM alpine:3.23.3 AS builder
# based on https://bigmike.help/ru/devops/034/
# https://tdlib.github.io/telegram-bot-api/build.html?os=Linux
ARG TELEGRAM_BOT_API_REF=master
RUN apk add --no-cache \
alpine-sdk \
linux-headers \
git \
zlib-dev \
openssl-dev \
gperf \
cmake \
curl \
ca-certificates \
musl-dev \
make \
pkgconfig \
autoconf \
automake \
libtool
RUN git clone --recursive https://github.com/tdlib/telegram-bot-api.git /src --depth 1 --branch ${TELEGRAM_BOT_API_REF}
WORKDIR /src
RUN set -x && \
rm -rf build && \
mkdir /src/build && \
cd /src/build && \
nproc=$(n=$(nproc) ; max_n=5 ; echo $(( n <= max_n ? n : max_n )) ) && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
cmake --build . --target telegram-bot-api -j"$nproc" && \
strip /src/build/telegram-bot-api
FROM alpine:3.23.3
RUN apk add --no-cache \
libstdc++ \
curl \
ca-certificates \
tzdata \
libssl3 \
zlib
COPY --from=builder /src/build/telegram-bot-api /usr/local/bin/telegram-bot-api
EXPOSE 8081
WORKDIR /data
VOLUME /data
ENTRYPOINT ["/usr/local/bin/telegram-bot-api"]