Integrate Claude Router v1.1.0 as a new service in the main docker-compose stack: Features: - Smart API router with automatic failover between Claude Pro and Claude API - Scheduled health checks every hour (0-4 minutes) to detect quota recovery - Intelligent auto-switch back to Claude Pro when available - Manual health check endpoint for immediate testing - Complete documentation and Docker containerization - Compatible with Claude Code CLI Changes: - Add router/ subdirectory with complete Claude Router project - Integrate claude-router service into main docker-compose.yml - Resolve port conflict (move SillyTavern to 8002, Claude Router uses 8000) - Update .gitignore for router-specific exclusions The router automatically detects when Claude Pro quota is restored and switches back to prioritize the premium service. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
189 lines
4.1 KiB
YAML
189 lines
4.1 KiB
YAML
services:
|
|
# Discord Bot (使用救援镜像)
|
|
discordbot:
|
|
image: discord_bot-discordbot:latest
|
|
container_name: discordbot
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- discord_config:/app/config
|
|
- discord_logs:/app/logs
|
|
- ./discord_tokens.txt:/app/tokens.txt:ro
|
|
networks:
|
|
- web_network
|
|
|
|
# Portainer - Docker管理界面
|
|
portainer:
|
|
image: portainer/portainer-ce:latest
|
|
container_name: portainer
|
|
restart: unless-stopped
|
|
ports:
|
|
- "9000:9000"
|
|
- "9443:9443"
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- portainer_data:/data
|
|
networks:
|
|
- web_network
|
|
|
|
# Caddy - Web服务器和反向代理
|
|
caddy:
|
|
image: caddy:latest
|
|
container_name: caddy
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
networks:
|
|
- web_network
|
|
|
|
# Jellyfin - 媒体服务器
|
|
jellyfin:
|
|
image: jellyfin/jellyfin:latest
|
|
container_name: jellyfin
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8096:8096"
|
|
volumes:
|
|
- jellyfin_config:/config
|
|
- jellyfin_cache:/cache
|
|
- /mnt/data/media:/media:ro
|
|
networks:
|
|
- web_network
|
|
|
|
# qBittorrent - 下载工具
|
|
qbittorrent:
|
|
image: linuxserver/qbittorrent:latest
|
|
container_name: qbittorrent
|
|
restart: unless-stopped
|
|
ports:
|
|
- "18080:8080"
|
|
- "6881:6881"
|
|
- "6881:6881/udp"
|
|
environment:
|
|
- PUID=1000
|
|
- PGID=1000
|
|
- TZ=America/Chicago
|
|
volumes:
|
|
- qbittorrent_config:/config
|
|
- /mnt/data/downloads:/downloads
|
|
networks:
|
|
- web_network
|
|
|
|
# Vaultwarden - 密码管理器
|
|
vaultwarden:
|
|
image: vaultwarden/server:alpine
|
|
container_name: vaultwarden
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8081:80"
|
|
environment:
|
|
- WEB_VAULT_ENABLED=false
|
|
volumes:
|
|
- vaultwarden_data:/data
|
|
networks:
|
|
- web_network
|
|
|
|
# AdGuard Home - DNS服务器
|
|
adguardhome:
|
|
image: adguard/adguardhome:latest
|
|
container_name: adguardhome
|
|
restart: unless-stopped
|
|
ports:
|
|
- "53:53/tcp"
|
|
- "53:53/udp"
|
|
- "3000:3000/tcp"
|
|
volumes:
|
|
- adguard_conf:/opt/adguardhome/conf
|
|
- adguard_work:/opt/adguardhome/work
|
|
networks:
|
|
- web_network
|
|
|
|
# Gitea - Git服务
|
|
gitea:
|
|
image: gitea/gitea:latest
|
|
container_name: gitea
|
|
restart: unless-stopped
|
|
ports:
|
|
- "13000:13000"
|
|
- "222:22"
|
|
environment:
|
|
- USER_UID=1000
|
|
- USER_GID=1000
|
|
volumes:
|
|
- gitea_data:/data
|
|
networks:
|
|
- web_network
|
|
|
|
# Home Assistant - 智能家居
|
|
homeassistant:
|
|
image: ghcr.io/home-assistant/home-assistant:stable
|
|
container_name: homeassistant
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8123:8123"
|
|
environment:
|
|
- TZ=America/Chicago
|
|
volumes:
|
|
- homeassistant_config:/config
|
|
networks:
|
|
- web_network
|
|
|
|
# SillyTavern - AI聊天
|
|
sillytavern:
|
|
image: ghcr.io/sillytavern/sillytavern:latest
|
|
container_name: sillytavern
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8002:8000" # Changed port to avoid conflict with claude-router
|
|
environment:
|
|
- TZ=America/Chicago
|
|
volumes:
|
|
- sillytavern_data:/home/node/app/data
|
|
networks:
|
|
- web_network
|
|
|
|
# Claude Router - AI API智能路由器
|
|
claude-router:
|
|
build: ./router
|
|
container_name: claude-router
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- CLAUDE_API_KEY=${CLAUDE_API_KEY}
|
|
volumes:
|
|
- ./tokens.txt:/home/will/docker/tokens.txt:ro
|
|
networks:
|
|
- web_network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
volumes:
|
|
discord_config:
|
|
discord_logs:
|
|
portainer_data:
|
|
caddy_data:
|
|
caddy_config:
|
|
jellyfin_config:
|
|
jellyfin_cache:
|
|
qbittorrent_config:
|
|
vaultwarden_data:
|
|
adguard_conf:
|
|
adguard_work:
|
|
gitea_data:
|
|
homeassistant_config:
|
|
sillytavern_data:
|
|
|
|
networks:
|
|
web_network:
|
|
driver: bridge |