fix config
This commit is contained in:
@@ -30,7 +30,7 @@ RUN set -x && \
|
|||||||
rm -rf build && \
|
rm -rf build && \
|
||||||
mkdir /src/build && \
|
mkdir /src/build && \
|
||||||
cd /src/build && \
|
cd /src/build && \
|
||||||
nproc=$(n=$(nproc) ; max_n=6 ; echo $(( n <= max_n ? n : max_n )) ) && \
|
nproc=$(n=$(nproc) ; max_n=5 ; echo $(( n <= max_n ? n : max_n )) ) && \
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
|
||||||
cmake --build . --target telegram-bot-api -j"$nproc" && \
|
cmake --build . --target telegram-bot-api -j"$nproc" && \
|
||||||
strip /src/build/telegram-bot-api
|
strip /src/build/telegram-bot-api
|
||||||
@@ -46,25 +46,13 @@ RUN apk add --no-cache \
|
|||||||
libssl3 \
|
libssl3 \
|
||||||
zlib
|
zlib
|
||||||
|
|
||||||
RUN set -x && \
|
|
||||||
mkdir -p /var/lib/telegram-bot-api && \
|
|
||||||
deluser telegram-bot-api 2>/dev/null; delgroup telegram-bot-api 2>/dev/null; \
|
|
||||||
addgroup -S telegram-bot-api -g 5555 && adduser -S -u 5555 -G telegram-bot-api -g telegram-bot-api -H -D -s /bin/false -h /var/lib/telegram-bot-api telegram-bot-api
|
|
||||||
|
|
||||||
COPY --from=builder /src/build/telegram-bot-api /usr/local/bin/telegram-bot-api
|
COPY --from=builder /src/build/telegram-bot-api /usr/local/bin/telegram-bot-api
|
||||||
|
|
||||||
EXPOSE 8081
|
EXPOSE 8081
|
||||||
|
|
||||||
ENV HEALTH_PORT=8081
|
WORKDIR /data
|
||||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
|
||||||
CMD curl -fsS "http://127.0.0.1:${HEALTH_PORT}/" >/dev/null || exit 1
|
|
||||||
|
|
||||||
USER telegram-bot-api
|
VOLUME /data
|
||||||
WORKDIR /var/lib/telegram-bot-api
|
|
||||||
|
|
||||||
VOLUME /var/lib/telegram-bot-api
|
|
||||||
|
|
||||||
# Параметры (api-id, api-hash, порты, директории) передаются через docker-compose:
|
|
||||||
# command: ["--api-id=...", "--api-hash=...", "--http-port=8081", "--dir=/var/lib/telegram-bot-api"]
|
|
||||||
ENTRYPOINT ["/usr/local/bin/telegram-bot-api"]
|
ENTRYPOINT ["/usr/local/bin/telegram-bot-api"]
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,30 @@
|
|||||||
services:
|
services:
|
||||||
tg-bot-api:
|
tg-bot-api:
|
||||||
build: build
|
build: build
|
||||||
restart: no
|
command: >-
|
||||||
|
--http-stat-port=8087
|
||||||
|
--max-webhook-connections=100
|
||||||
|
--max-connections=100
|
||||||
|
--dir="/data"
|
||||||
|
--temp-dir="/data/tmp"
|
||||||
|
--log=/dev/stdout
|
||||||
|
--verbosity=1
|
||||||
|
# --proxy="..."
|
||||||
|
restart: unless-stopped
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
healthcheck:
|
||||||
|
test: curl -fsS http://127.0.0.1:8087/ -o /dev/null || exit 1
|
||||||
|
start_period: 10s
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
#user: $UID:$GID
|
||||||
#volumes:
|
#volumes:
|
||||||
# - "./data:/var/lib/telegram-bot-api:rw"
|
# - "./data:/data:rw"
|
||||||
#ports:
|
#ports:
|
||||||
# - "8081:8081/tcp"
|
# - "8081:8081/tcp" # main port
|
||||||
|
# - "8087:8087/tcp" # stats port
|
||||||
#env_file:
|
#env_file:
|
||||||
# - .env
|
# - .env
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
Reference in New Issue
Block a user