Comments (25)
@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.
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.
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.
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.
I made one for testing https://hub.docker.com/r/julyighor/telegram-bot-api
from telegram-bot-api.
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.
@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.
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.
Just added Github Actions on this project, then it will auto build an alpine docker for every update.
where?
from telegram-bot-api.
@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.
@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 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.
they use the MTProto Mobile Protocol I assume. https://core.telegram.org/mtproto
from telegram-bot-api.
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.
much more possibilities of that bot than just using public bot API.
no. checkout #1 for that discussion
from telegram-bot-api.
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.
https://hub.docker.com/r/aiogram/telegram-bot-api
from telegram-bot-api.
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.
For now we wouldn't add an official Dockerfile, but such a file can be added in the future.
from telegram-bot-api.
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.
@JulyIghor There are no plans to do that in the near future.
from telegram-bot-api.
@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.
@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 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.
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)
- Limits on deleteMessages HOT 1
- Error while getting api_hash and api_id. HOT 11
- The terminal does not respond after the command is executed HOT 1
- Add support for `channels.toggleForum` (as per documentation) HOT 7
- Connection refused HOT 1
- send a pdf document with sendMessage HOT 9
- Fatal log is already here:
- Let's imagine that we have a ~4gb file, and a premium subscription on the account. So we are trying to upload the file using preliminary wrappers, we do perform the request, wait until the file is loaded, and chunk are saved on the server-side/cdn whatever, close the database, then we open it again, let's say 10 minutes later, we are trying to upload it, but due to the tdlib cache we just run into a weird situation where the filds 'is_uploading_active' are being set as true in the response to the original 'preliminaryUploadFile', even though the file is already uploaded and the uploaded_size matches the size, and expected_size fields values, while 'is_uploading_completed' is being set to false.
- [Question]: Is `ChatJoinRequest.invite_link` always null for public groups? HOT 1
- How legal is using getChannelDifference for public channels HOT 5
- hajaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar
- Does telegram-bot-api still not support uploading files up to 4G? HOT 7
- How to create a service on Ubuntu HOT 1
- Tgram.api
- http proxy does not work! HOT 1
- Message entities are not preserved by `editMessageText` and `editMessageMedia` HOT 2
- Request: Add Possibility for bot to publish/maintain stories in Channels
- NOT: User.language_code described at IETF but only being used as ISO-639? HOT 3
- How should I apply for the API HOT 4
- How can I be sure that Telegram BOT API local server is running properly? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram-bot-api.