Under the hood: aiogram, PostgreSQL, Redis, GigaChat
- Download the source code from the repository
- Create a .env file from the template .env
- Run docker compose up --build to build the image
- For the first run, type /start; for subsequent runs, type /get_question in the bot or use the buttons
- Specify a test TG_TOKEN in .env and DB_HOST=localhost for localhost
- Start the database container: docker run --name pg-container -e POSTGRES_DB=inter_db -e POSTGRES_USER=inter_user -e POSTGRES_PASSWORD=inter_password -p 5432:5432 -d postgres:15`
- Start the Redis container:
docker run -d -p 6379:6379 --name redis_local redis_local - Download the Ministry of Digital Development, Communications and Mass Media certificate (on Mac):
curl -k "https://gu-st.ru/content/Other/doc/russian_trusted_root_ca.cer" -o russian_trusted_root_ca.cer - Install the certificate:
cat russian_trusted_root_ca.cer >> $(python -m certifi) - Run main.py, you can do this directly from the console.
- To check for asynchrony, you can run
pyinstrument:PYTHONPATH=. pyinstrument src/main.py -t -r RENDERER - For general profiling, use
scalene:scalene --cpu --memory --cli src/main.py