-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
46 lines (42 loc) · 1.47 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM alpine:3.20 as builder
RUN apk --no-cache --update add \
build-base \
cmake \
openssl-dev \
zlib-dev \
gperf \
linux-headers \
upx
WORKDIR /app
COPY telegram-bot-api/CMakeLists.txt .
COPY telegram-bot-api/td ./td
COPY telegram-bot-api/telegram-bot-api ./telegram-bot-api
WORKDIR /app/build
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. .. \
&& cmake --build . --target install -j "$(nproc)"\
&& strip /app/bin/telegram-bot-api \
&& upx --brute /app/bin/telegram-bot-api
FROM alpine:3.20
ENV TELEGRAM_WORK_DIR="/var/lib/telegram-bot-api" \
TELEGRAM_TEMP_DIR="/tmp/telegram-bot-api"
RUN apk --no-cache --update add \
libstdc++ \
openssl
COPY --from=builder \
/app/bin/telegram-bot-api \
/usr/local/bin/telegram-bot-api
COPY docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 8081/tcp 8082/tcp
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
HEALTHCHECK \
--interval=5s \
--timeout=30s \
--retries=3 \
CMD nc -z localhost 8081 || exit 1
LABEL org.opencontainers.image.authors="Divanshu Chauhan <[email protected]>"
LABEL org.opencontainers.image.url="https://divkix.me"
LABEL org.opencontainers.image.source="https://github.com/divideprojects/docker-telegram-bot-api"
LABEL org.opencontainers.image.title="Docker Telegram Bot API"
LABEL org.opencontainers.image.description="Docker image of telegram-bot-api built using Github Actions"
LABEL org.opencontainers.image.vendor="Divkix"