-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
46 lines (33 loc) · 1.46 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
# Stage 1: Build Stage
FROM alpine:3.21.3 AS build-stage
LABEL org.opencontainers.image.description="Telegram Bot API server provides an HTTP API for creating Telegram Bots."
LABEL org.opencontainers.image.title="telebram-bot-api"
LABEL org.opencontainers.image.url="https://github.com/ragnarok22/telegram-bot-api-docker"
LABEL org.opencontainers.image.source="https://github.com/ragnarok22/telegram-bot-api-docker"
LABEL org.opencontainers.image.version="8.2"
LABEL org.opencontainers.image.authors="Reinier Hernández<[email protected]>"
RUN apk update && \
apk upgrade && \
apk add --update alpine-sdk linux-headers git zlib-dev openssl-dev gperf cmake && \
rm -rf /var/cache/apk/*
RUN git clone --recursive https://github.com/tdlib/telegram-bot-api.git /telegram-bot-api
WORKDIR /telegram-bot-api
RUN rm -rf build && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. .. && \
cmake --build . --target install
# Stage 2: Final Stage
FROM alpine:3.21.3
# Copy only the necessary files from the build stage
COPY --from=build-stage /telegram-bot-api/bin/ /telegram-bot-api/bin/
RUN apk update && \
apk upgrade && \
apk add --update libstdc++ libgcc && \
rm -rf /var/cache/apk/*
WORKDIR /telegram-bot-api/bin
# COPY entrypoint.sh /telegram-bot-api/bin/entrypoint.sh
COPY --chmod=755 entrypoint.sh /telegram-bot-api/bin/entrypoint.sh
VOLUME /data/logs
VOLUME /tmp
ENTRYPOINT ["./entrypoint.sh"]