| Requirement | Notes |
|---|---|
| Docker Engine + Docker Compose v2 | Windows: install Docker Desktop |
| Git | To clone the repository |
| Hardware | 2 CPU cores, 2 GB RAM, 10 GB disk (minimum) |
| Variable | Source | Required? |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Create a bot via @BotFather | Yes |
API_KEY_OPENAI |
OpenAI Platform | Yes |
POSTGRES_USER |
Choose any username | Yes |
POSTGRES_PASSWORD |
Choose a strong password | Yes |
POSTGRES_DB |
Choose a database name | Yes |
DATABASE_URL |
Built from the PG values above | Yes |
REDIS_URL |
redis://redis:6379 |
Yes |
API_KEY_TON |
TON API key | Optional (pay mode) |
TON_ADDRESS |
TON wallet address | Optional (pay mode) |
ADDRESS_SOL |
Solana wallet public key | Optional (token swap) |
MINT_TOKEN_ADDRESS |
SPL token mint address | Optional (pay mode) |
TOKEN_BURN_ADDRESS |
Token burn address | Optional (pay mode) |
git clone <repo-url>
cd evi-run
.envcp .env.example .env
Edit .env and fill in all required values. Pay attention to DATABASE_URL — it must use the Docker service name postgres as the host (not localhost):
DATABASE_URL=postgresql+psycopg://evi_user:YOUR_PASSWORD@postgres:5432/evi_db
REDIS_URL=redis://redis:6379
Important: Use the container-internal ports (
5432for PostgreSQL,6379for Redis), not the host-mapped ports (5434,6380).
config.pyEdit config.py and set your Telegram user ID:
ADMIN_ID = 123456789 # Your Telegram ID
ADMINS_LIST = [123456789] # List of admin Telegram IDs
TYPE_USAGE = 'private' # 'private', 'free', or 'pay'
To find your Telegram ID, message @userinfobot.
docker compose up --build -d
# Check all containers are running
docker compose ps
# Watch bot logs
docker compose logs -f bot
# Check database is healthy
docker compose logs postgres
The deployment runs 3 containers (4 if the optional payment module is enabled):
┌─────────────┐
│ bot_agent │
│ (Telegram) │
└──────┬───┬──┘
│ │
┌───────────┘ └───────────┐
▼ ▼
┌────────────────┐ ┌──────────────────┐
│ postgres_agent │ │ redis_agent │
│ (PostgreSQL) │ │ (Redis) │
│ :5434 → :5432 │ │ :6380 → :6379 │
└────────────────┘ └──────────────────┘
Data persistence:
./data/postgres/postgres_data — PostgreSQL data./data/redis/data — Redis data./data/images — Generated imagesThe fastapi service is commented out by default because the payment_module/ directory is not included in the repository. If you have the payment module:
payment_module/ directory in the project rootfastapi service block in docker-compose.ymlfastapi to the bot's depends_on sectiondocker compose up --build -ddocker compose logs bot
Common causes:
TELEGRAM_BOT_TOKENAPI_KEY_OPENAIdocker compose logs postgres)DATABASE_URL in .env uses postgres as host (not localhost)POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB match between the .env values and DATABASE_URLREDIS_URL uses redis as host (not localhost).env changesEnvironment variables are injected via env_file in docker-compose.yml, so a simple restart should pick up changes:
docker compose down && docker compose up -d
However, if you change dependencies or code, rebuild:
docker compose up --build -d
docker compose down -v
rm -rf data/postgres data/redis
docker compose up --build -d