Giter VIP home page Giter VIP logo

Comments (25)

JulyIghor avatar JulyIghor commented on June 19, 2024 4

@cybervagabond If you want to build the Telegram Bot API server and run it using Docker, just do that. There can't be a Dockerfile that fits everyone needs. From the other side, writing a Dockerfile for the Telegram Bot API server is very simple and straightforward. So creation of the Dockerfile will be left for the server owner.

I think it is all about simplifying updates, if a build instructions changed, it will requires more time for update.
And if there is a official docker hub image (with multi arch support), that is updated automatically, it makes a life much more easier.

from telegram-bot-api.

mr-linch avatar mr-linch commented on June 19, 2024 3

Hello. While we are waiting for the official image, you can use ours: ghcr.io/bots-house/docker-telegram-bot-api:latest. Repository and examples: bots-house/docker-telegram-bot-api

UPD1: add tagged builds
UPD2: add auto rebuild when someone push to upstream repo

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024 2

I also made one, It take 30 minutes to build telegram-bot-api. Image size ~40MB.

FROM alpine:3.7 as builder
WORKDIR /server

RUN apk add --update alpine-sdk linux-headers git zlib-dev openssl-dev gperf cmake
RUN git clone --recursive https://github.com/tdlib/telegram-bot-api.git
RUN mkdir ./telegram-bot-api/build
RUN cd ./telegram-bot-api/build && \
  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. ..
RUN cd ./telegram-bot-api/build && \
  cmake --build . --target install

FROM alpine:3.7
RUN apk add --update openssl libstdc++
COPY --from=builder /server/telegram-bot-api/bin/telegram-bot-api /telegram-bot-api
ENTRYPOINT ["/telegram-bot-api"]

To build your own:

docker build . --tag=telegram-bot-api
docker run -it telegram-bot-api

Looks similar to mine. Are you sure that ca-certificates is not required?

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024 2

I also made one, It take 30 minutes to build telegram-bot-api. Image size ~40MB.

You will get much less size if used strip /telegram-bot-api
Mine image compressed size is 12.47 MB

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024 1

I made one for testing https://hub.docker.com/r/julyighor/telegram-bot-api

from telegram-bot-api.

giautm avatar giautm commented on June 19, 2024 1

I also made one, It take 30 minutes to build telegram-bot-api. Image size ~40MB.

FROM alpine:3.7 as builder
WORKDIR /server

RUN apk add --update alpine-sdk linux-headers git zlib-dev openssl-dev gperf cmake
RUN git clone --recursive https://github.com/tdlib/telegram-bot-api.git
RUN mkdir ./telegram-bot-api/build
RUN cd ./telegram-bot-api/build && \
  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. ..
RUN cd ./telegram-bot-api/build && \
  cmake --build . --target install
RUN strip telegram-bot-api/bin/telegram-bot-api

FROM alpine:3.7
RUN apk add --update openssl libstdc++
COPY --from=builder /server/telegram-bot-api/bin/telegram-bot-api /bin/telegram-bot

ENTRYPOINT ["/bin/telegram-bot"]

To build your own:

docker build . --tag=telegram-bot-api
docker run -it telegram-bot-api

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024 1

@JulyIghor Build instructions are very unlikely to change and even they do, they can still be copypasted from the build instructions generator.

Requests to Telegram Bot API server hosted on api.telegram.org must be TLS-encrypted.

Requests from Telegram Bot API server to Telegram servers are MTProto-encrypted.

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024 1

Also, we should use upx, too.

upx -q -9 /telegram-bot-api

I don't think so, we will get both compressed and uncompressed binaries loaded in RAM
And longer time to start.
strip - just removing debug symbols, since we are not going to debug the binary they are useless anyway

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024 1

Just added Github Actions on this project, then it will auto build an alpine docker for every update.

where?

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024

@cybervagabond If you want to build the Telegram Bot API server and run it using Docker, just do that. There can't be a Dockerfile that fits everyone needs. From the other side, writing a Dockerfile for the Telegram Bot API server is very simple and straightforward. So creation of the Dockerfile will be left for the server owner.

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024

@JulyIghor CA certificates will be needed for a TLS termination proxy like Nginx, which should be used to handle remote HTTPS requests.

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024

@JulyIghor CA certificates will be needed for a TLS termination proxy like Nginx, which should be used to handle remote HTTPS requests.

Thats right, so requests to a telegram api servers isn't TLS encrypted?

from telegram-bot-api.

Poolitzer avatar Poolitzer commented on June 19, 2024

they use the MTProto Mobile Protocol I assume. https://core.telegram.org/mtproto

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024

they use the MTProto Mobile Protocol I assume. https://core.telegram.org/mtproto

If so, there could be much more possibilities of that bot than just using public bot API.

from telegram-bot-api.

Poolitzer avatar Poolitzer commented on June 19, 2024

much more possibilities of that bot than just using public bot API.

no. checkout #1 for that discussion

from telegram-bot-api.

giautm avatar giautm commented on June 19, 2024

I also made one, It take 30 minutes to build telegram-bot-api. Image size ~40MB.

You will get much less size if used strip /telegram-bot-api
Mine image compressed size is 12.47 MB

ya, I forgot to use strip. 😄

Also, we should use upx, too.

upx -q -9 /telegram-bot-api

from telegram-bot-api.

JrooTJunior avatar JrooTJunior commented on June 19, 2024

https://hub.docker.com/r/aiogram/telegram-bot-api

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024

To answer original question, yes, it should be dockerized. But given that there can't be a Dockerfile that fits everyone needs, it is better created by the server owner. At the worst, if the owner wants to use Docker, but can't write a very simple Dockerfile, then one of dozens Dockerfile created and mantained by others can be used.

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024

For now we wouldn't add an official Dockerfile, but such a file can be added in the future.

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024

For now we wouldn't add an official Dockerfile, but such a file can be added in the future.

Will you publish official docker image here https://hub.docker.com anytime soon?

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024

@JulyIghor There are no plans to do that in the near future.

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024

@JulyIghor There are no plans to do that in the near future.

ok, so we have a big chance that some third party devs will make docker hub repo which will become very popular

from telegram-bot-api.

levlam avatar levlam commented on June 19, 2024

@JulyIghor Do you see any problem with that? If it is a good enough repo and its owner is trusted, why it shouldn't be popular?

from telegram-bot-api.

JulyIghor avatar JulyIghor commented on June 19, 2024

@JulyIghor Do you see any problem with that? If it is a good enough repo and its owner is trusted, why it shouldn't be popular?

Less third parties involved in a project, more secure it is.
More parties we have to trust, more chances for a problems.
They may delay updates sometimes, or stop releasing updates one day and do not notify users.
So dealing with the only official source, Telegram, is the best possible option for me.
And I'll be happy to get a official repo any time in future.

from telegram-bot-api.

giautm avatar giautm commented on June 19, 2024

Just added Github Actions on this project, then it will auto build an alpine docker for every update.

from telegram-bot-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.