Simple aiogram webhook template based on fastapi.
Tested on Ubuntu 24.04, Python 3.12, Docker version 28.5.0
-
Rename example.config.yaml to config.yaml, example.env to .env, example.docker-compose.yml to docker-compose.yml
-
Fill TELEGRAM_API_ID and TELEGRAM_API_HASH in .env file. Use this for obtain values.
-
Fill token in config.yaml. Use BotFather for obtain it.
Keep
webhook_workers: 1while the template uses in-memory FSM storage.webhook_urlis the URL registered in Telegram, whilewebhook_listen_hostandwebhook_listen_portare the address bound by Uvicorn. -
docker-compose up -dor if you have new dockerdocker compose up -d -
Just test it: send message to your bot.
You can rent a server from various hosters, for example from Aeza.
By registering via the link you will support the project and receive a 15% bonus on your balance, which will be valid for 24 hours.
The bot will require the simplest VDS, in rubles this is approximately 100-200 for promotional offers, or about 500 rubles per month.
Feel free to create issue or pull request.
For development, you should install the requirements from requirements_dev.txt
pip install -r requirements_dev.txt
Use pre-commit run --all-files before commit.