This project uses Docker Compose to run: Postgres, Auth FastAPI, Whisper, Telegram Bot, Frontend (nginx), and Gateway (nginx).
- Docker Desktop 4.x
- Compose V2 (
docker compose ...)
Create .env in the project root (same directory as docker-compose.yml) with Unix line endings (LF):
POSTGRES_USER=calendar
POSTGRES_PASSWORD=calendar
POSTGRES_DB=calendar
DATABASE_URL=postgresql+psycopg2://calendar:calendar@postgres:5432/calendar
SECRET_KEY=change-me
BOT_TOKEN=123456789:AA...your-token
SITE_URL=https://your-domain-or-ngrok.ngrok-free.app
- SITE_URL must be a public
httpsURL. The bot will normalize it tohttps://.../profile. - Use LF line endings. In editors like VS Code: bottom-right corner → set to LF.
docker compose down
# explicitly pass the root .env for safety on Windows
docker compose --env-file ./.env up -d --build
docker compose config | sed -n '/telegram-bot:/,/^[^ ]/p'
You should see telegram-bot.environment include BACKEND_URL and SITE_URL with values. Then check logs:
docker compose logs telegram-bot --tail=200 -f
# Expect lines:
# [bot] BACKEND_URL = http://auth-service:8000
# [bot] SITE_URL = https://.../profile
If needed, exec into the container and confirm env:
docker compose exec telegram-bot sh -c 'env | grep -E "BOT_TOKEN|SITE_URL|BACKEND_URL"'
- Send
/startto receive a button that opens yourSITE_URLnormalized to/profile. - On the website, generate a link code (Profile → Telegram). In Telegram, use:
/link <CODE>to bind, the bot will callhttp://auth-service:8000/telegram/confirminternally./unlinkto unbind.
- Container restarting with
BOT_TOKEN not setorSITE_URL not set or invalid:- Ensure
.envexists in project root and keys are present without quotes. - Convert
.envto LF line endings. - Start with
docker compose --env-file ./.env up -d --build.
- Ensure
SITE_URLmust be a public https URL (not localhost). Use an HTTPS tunnel/domain.- Check
docker compose configto confirm variables are interpolated.