LichessStatTgWeb/docker-compose.yml
vrubelroman 6355cd917d fix log bloat, token leak, silent onboarding gaps, closed-account adds, case-duplicate gamers
- log rotation (50m x 3) for all services in both compose files
- httpx logger -> WARNING: it logged every Telegram call with the bot token in the URL
- LOG_LEVEL env (INFO default); admin_bot no longer forces the level via import-time basicConfig
- periodic_check chatter (API dumps, timestamps, waits) moved to DEBUG
- error_handler logs the real traceback (exc_info) plus the offending user/update
- drop_pending_updates=False so /start during a restart isn't silently lost
- TTS announcer behind optional TTS_URL (unreachable from prod, was failing on every event)
- reject closed Lichess accounts on /addgamer (API answers 200 with disabled=true)
- store Lichess' canonical username spelling; merge case-duplicate gamers at startup,
  case-insensitive unique index prevents new ones
- reply with a hint on text outside the /addgamer flow and on non-text messages;
  one INFO line per incoming update for funnel visibility
- gamer_added counter for successful adds; /setperiod localized (ru hour plurals)
- drop hardcoded /home/vrubel path for help images

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-20 21:21:19 +00:00

87 lines
2 KiB
YAML

services:
# Lichess Web Services (API)
lichess-api:
build: ./LichessWebServices
image: 192.168.8.174:3000/vrubel/lichess-api:latest
container_name: lichess-api
ports:
- "8002:8000"
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
volumes:
- ./LichessWebServices:/app
restart: always
logging:
driver: json-file
options:
max-size: "50m"
max-file: "3"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health').read()"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Telegram Bot
lichess-bot:
build: ./LichessClientTG_bot
image: 192.168.8.174:3000/vrubel/lichess-bot:latest
container_name: lichess-telegram-bot
volumes:
- ./LichessClientTG_bot/data:/app/data
- ./LichessClientTG_bot:/app
env_file:
- .env
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
network_mode: "host"
restart: always
logging:
driver: json-file
options:
max-size: "50m"
max-file: "3"
depends_on:
- lichess-api
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8002/health', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Admin Panel Telegram Bot
admin-bot:
build:
context: ./LichessClientTG_bot
dockerfile: Dockerfile.admin
image: 192.168.8.174:3000/vrubel/lichess-admin:latest
container_name: lichess-admin-bot
volumes:
- ./LichessClientTG_bot/data:/app/data
- ./LichessClientTG_bot:/app
env_file:
- .env
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
network_mode: "host"
restart: always
logging:
driver: json-file
options:
max-size: "50m"
max-file: "3"
depends_on:
- lichess-api
networks:
default:
name: lichess-network