42 lines
1.5 KiB
YAML
42 lines
1.5 KiB
YAML
# Telegram bot adapter — run on a separate server.
|
|
#
|
|
# The bot is deliberately stateless: it polls Telegram and talks to the central
|
|
# API over HTTP(S). It needs NO DB/MQ/S3 credentials, only BOT_TOKEN,
|
|
# BOT_SERVICE_TOKEN and API_URL. Keep this server lean and firewall-hardened.
|
|
#
|
|
# Usage on the bot server:
|
|
# cp .env.bot.example .env # minimal bot-only environment
|
|
# docker compose -f docker-compose.bot.yml up -d --build
|
|
#
|
|
# See docs/DEPLOY.md §14 for the full separate-server guide.
|
|
|
|
services:
|
|
bot:
|
|
build:
|
|
context: .
|
|
dockerfile: srv/bot/Dockerfile
|
|
container_name: contract_check-bot
|
|
restart: unless-stopped
|
|
env_file:
|
|
- path: .env
|
|
required: false
|
|
environment:
|
|
ENV: ${ENV:-prod}
|
|
LOG_LEVEL: ${LOG_LEVEL:-INFO}
|
|
LOG_FORMAT: ${LOG_FORMAT:-json}
|
|
BOT_TOKEN: ${BOT_TOKEN}
|
|
API_URL: ${API_URL}
|
|
BOT_SERVICE_TOKEN: ${BOT_SERVICE_TOKEN}
|
|
# Optional Redis for shared rate-limit state across bot replicas.
|
|
# Leave empty (or omit) to use the in-memory backend; safe for a single
|
|
# bot instance. If set, Redis must be reachable from this host (private
|
|
# network / VPN — do NOT expose Redis to the public internet).
|
|
REDIS_URL: ${REDIS_URL:-}
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- "python -c \"import urllib.request, os; urllib.request.urlopen(os.environ['API_URL'] + '/healthz', timeout=5)\""
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|