Telegram Bot template with aiogram, SQLAlchemy and docker
- Aiogram
- Redis
- SQLAlchemy
- SQLite3
- PostgreSQL
- i18n
- Docker and docker compose
$ git clone -b aiogram3 https://github.com/webshining/aiogram-mongo-template project_name
$ cd project_name
$ pip install -r requirements.txt
$ poetry install # If you use poetry. Don't forget to select an interpreter
Copy variables from .env.ren file to .env
$ cp .env.ren .env
TELEGRAM_BOT_TOKEN
- your bot token (required)
I18N_DOMAIN
- locales file name
If you are not using redis, by default used MemoryStorage
RD_DB
- your redis database (number)
RD_HOST
- your redis host
RD_PORT
- your redis port
You can specify RD_URI instead of RD_DB, RD_HOST and RD_PORT
RD_URI
- connection url to your redis server
DB_URI format
>dialect+driver://username:password@host:port/database
DB_USER
- your database username
DB_PASS
- your database password
DB_NAME
- your database name
DB_HOST
- your database host
DB_PORT
- your database port
You can specify DB_URI instead of DB_USER, DB_PASS, DB_NAME, DB_HOST and DB_PORT
DB_URI
- connection url to your database server
$ python main.py
# If you have make you can enter
$ make run
Run only one service:
$ docker-compose up -d service-name
$ docker-compose up -d
# If you have make you can enter
$ make rebuild
$ docker-compose logs -f app
# If you have make you can enter
$ make logs
$ docker-compose up -d --build --no-deps --force-recreate
# If you have make you can enter
$ make rebuild