blob: 7bd3c79abcf4c0e3571b6824090e9ff9d9ee47b0 [file] [log] [blame] [raw]
version: '3.8'
services:
tomato-bot:
build:
context: ../..
dockerfile: Dockerfile
container_name: claude-bot-tomato
restart: unless-stopped
stop_grace_period: 30s # 优雅关闭等待时间
environment:
# Claude API 配置
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- ANTHROPIC_BASE_URL=https://api.dreamchatbot.top
# Telegram Bot 配置
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- TELEGRAM_ALLOWED_USERS=${TELEGRAM_ALLOWED_USERS}
- TELEGRAM_ALLOWED_GROUPS=${TELEGRAM_ALLOWED_GROUPS}
# Bot配置文件选择
- CLAUDE_CONFIG=tomato_private
volumes:
# 挂载CLAUDE.md个性提示词(只读)
- ./CLAUDE.md:/app/run/tomato/CLAUDE.md:ro
# 挂载日志文件
- ./bot.log:/app/logs/bot.log
- ./debug.log:/app/logs/debug.log
# 挂载数据存储(持久化对话历史)
- tomato_data:/app/data/storage
# 挂载Claude SDK sessions(V2.2必需)
- tomato_sessions:/home/claude/.claude/sessions
# 挂载临时文件目录
- tomato_temp:/app/temp/telegram
ports:
- "${WEBHOOK_PORT:-30541}:${WEBHOOK_PORT:-30541}"
command: ["python", "scripts/start_telegram_bot.py", "--working-dir", "/app/run/tomato"]
healthcheck:
test: ["CMD-SHELL", "ps aux | grep -v grep | grep -q python || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
tomato_data:
driver: local
tomato_sessions:
driver: local
tomato_temp:
driver: local
networks:
default:
name: claude-bot-tomato