https://github.com/luckydonald/docker-telegram-bot
Docker Images for Python Telegram Bots.
https://github.com/luckydonald/docker-telegram-bot
api bot container docker pytg pytgbot telegram
Last synced: 12 months ago
JSON representation
Docker Images for Python Telegram Bots.
- Host: GitHub
- URL: https://github.com/luckydonald/docker-telegram-bot
- Owner: luckydonald
- License: mit
- Created: 2017-11-20T20:40:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T00:48:27.000Z (about 6 years ago)
- Last Synced: 2025-04-12T13:13:11.381Z (about 1 year ago)
- Topics: api, bot, container, docker, pytg, pytgbot, telegram
- Language: Dockerfile
- Homepage:
- Size: 91.8 KB
- Stars: 11
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-telegram-bot
A flask based telegram bot docker container.
[](https://travis-ci.org/luckydonald/docker-telegram-bot)
###### [Docker Hub](https://hub.docker.com/r/luckydonald/telegram-bot/)
#### Image tags
- `python3.6-stretch-port`
- `python3.6-stretch-socket`
- `python3.6-stretch-port-onbuild`
- `python3.6-stretch-socket-onbuild`
- `python3.6.10-stretch-port`
- `python3.6.10-stretch-socket`
- `python3.6.10-stretch-port-onbuild`
- `python3.6.10-stretch-socket-onbuild`
- `python3.7-stretch-port`
- `python3.7-stretch-socket`
- `python3.7-stretch-port-onbuild`
- `python3.7-stretch-socket-onbuild`
- `python3.7.7-stretch-port`
- `python3.7.7-stretch-socket`
- `python3.7.7-stretch-port-onbuild`
- `python3.7.7-stretch-socket-onbuild`
- `python3.8-buster-port`
- `python3.8-buster-socket`
- `python3.8-buster-port-onbuild`
- `python3.8-buster-socket-onbuild`
- `python3.8.2-buster-port`
- `python3.8.2-buster-socket`
- `python3.8.2-buster-port-onbuild`
- `python3.8.2-buster-socket-onbuild`
See https://hub.docker.com/r/luckydonald/telegram-bot/tags for a list of existing image builds.
For version pinning we serve the image with the following tag structure:
- python{version}-{flavor}-port
- python{version}-{flavor}-port-{commit}
- python{version}-{flavor}-port-{YYYY-MM-DD}
- python{version}-{flavor}-port-{YYYY-MM-DD}-{commit}
- python{version}-{flavor}-port-onbuild
- python{version}-{flavor}-port-{commit}-onbuild
- python{version}-{flavor}-port-{YYYY-MM-DD}-onbuild
- python{version}-{flavor}-port-{YYYY-MM-DD}-{commit}-onbuild
- python{version}-{flavor}-socket
- python{version}-{flavor}-socket-{commit}
- python{version}-{flavor}-socket-{YYYY-MM-DD}
- python{version}-{flavor}-socket-{YYYY-MM-DD}-{commit}
- python{version}-{flavor}-socket-onbuild
- python{version}-{flavor}-socket-{commit}-onbuild
- python{version}-{flavor}-socket-{YYYY-MM-DD}-onbuild
- python{version}-{flavor}-socket-{YYYY-MM-DD}-{commit}-onbuild
The same with -port instead of -socket
_Need something else? Create an issue!_
#### Environment variables
###### `HEALTHCHECK_URL`:
Which url to call?
Default: `/healthcheck`
###### `SOCKET_PATH`: _(Only the `socket` image flavor)_
Allows to overwrite the place where we expect the socket.
Default: `/sockets/bots/${URL_PATH}.sock`
###### `SOCKET_TYPE`: _(Only the `socket` image flavor)_
Allows to overwrite the type of the file socket to use.
All [options](https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core) ending on `*-socket`.
Currently that's `uwsgi`, `http, `https`, as well as the lesser known , `suwsgi`, `ssl`, `http11`, `fastcgi`, `fastcgi-nph`, `scgi`, `scgi-nph`, `raw` and finally `puwsgi`.
Default: `uwsgi`
###### `HTTP_PORT`: _(Only the `port` image flavor)_
Allows to overwrite the http port we're listening on.
Default: `8080`
#### How to update the containers
I'll do that, don't worry.
But as I myself always forget how to, I'll write it down anyway:
###### Mac OS requirements
Gets you a better `sed` and as well as working `sort`. Actually some other great programs are also included, fully for free!
```bash
$ brew install gnu-sed coreutils
$ new_path='PATH="/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/coreutils/libexec/gnubin:$PATH"'
$ echo $new_path >> ~/.bashrc
$ eval $new_path
```
###### adding new versions
Those are simply done by creating new folders.
```bash
rm -r python*
mkdir -p python3.{6{,.10},7{,.7}}/stretch/{port,socket}{,/onbuild}
mkdir -p python3.8{,.2}/buster/{port,socket}{,/onbuild}
```
###### Just do it!
Execute the script, and push it to github.
Travis will build containers.
```bash
$ bash update.sh
```
After looking at the updated `Dockerfile`s and the `.travis.yml` let's git gud.
```bash
$ git add -u
$ git commit -m "Updated to latest version"
$ git push
```
That's it. Wait for Sir Travis to be done.