Compare commits

..

1 Commits

Author SHA1 Message Date
Terekhin Alexandr 32a5081623 Debug mode 4 years ago
  1. 8
      Dockerfile
  2. 6
      README.md
  3. 2
      build.sh

@ -1,14 +1,12 @@
FROM alpine:latest
RUN apk update && apk --no-cache upgrade \
&& apk add --no-cache openssl-dev linux-headers zlib-dev gcc gperf cmake build-base git libstdc++ \
RUN apk add --no-cache openssl-dev linux-headers zlib-dev gcc gperf cmake build-base git libstdc++ \
&& git clone --recursive https://github.com/tdlib/telegram-bot-api.git \
&& cd telegram-bot-api \
&& mkdir build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& cmake --build . -j 8 --target install \
&& cmake --build . -j 4 --target install \
&& apk del linux-headers gcc gperf cmake build-base git \
&& cd ../.. \
&& rm -r ./telegram-bot-api
RUN adduser --no-create-home --uid 2000 --disabled-password tg-bot \
&& mkdir -p /opt/telegram-bot-api \
@ -18,4 +16,4 @@ ENV TELEGRAM_API_ID=""
ENV TELEGRAM_API_HASH=""
EXPOSE 8081/tcp
USER tg-bot
ENTRYPOINT ["/usr/local/bin/telegram-bot-api", "--local", "--dir=/opt/telegram-bot-api"]
ENTRYPOINT ["/usr/local/bin/telegram-bot-api", "--local", "--dir=/opt/telegram-bot-api", "--http-stat-port=8082", "--log=/opt/telegram-bot-api/api.log", "--verbosity=5"]

@ -18,10 +18,6 @@ Or build manualy: `docker build -t <you image name> .`
And run it:
`docker run -p <host port>:8081 --name <you container name> --env-file=./tg-bot-api.env <you image name>`
## This image on dockerhub
Built for linux OS amd64 and arm/v7 arch https://hub.docker.com/r/bearns/tg-bot-api-server
## Crossbuild
Use qemu and buildx if you need it.
@ -31,6 +27,8 @@ Get buidlx here https://github.com/docker/buildx
Buildix documentation here https://docs.docker.com/buildx/working-with-buildx/
Run image
`docker run --privileged --rm docker/binfmt`
Or (alternative)
`docker run --privileged --rm multiarch/qemu-user-static:latest`
Create profile (linux/arm/v7 used as example)

@ -1,4 +1,4 @@
#!/bin/bash
docker build -t bearns.me/tg-api .
docker container rm tg-api
docker run --name tg-api --env-file=./tg-bot-api.env -p 8081:8081 bearns.me/tg-api
docker run --name tg-api --env-file=./tg-bot-api.env -p 8081:8081 -v /tmp:/opt/telegram-bot-api bearns.me/tg-api

Loading…
Cancel
Save