Files
droid2api/docker-compose.yml
empty 42fc3f2cf3 feat: 集成 Cloudflare Tunnel 支持
- docker-compose.yml 添加 cloudflared 服务
- 更新 .env.example 和 README.md 添加配置说明
- 支持通过 Cloudflare Tunnel 进行安全部署
2025-12-27 15:14:12 +08:00

44 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
droid2api:
build: .
container_name: droid2api
ports:
- "3001:3000"
environment:
# 认证配置(按优先级选择其一):
# 最高优先级固定API密钥推荐用于生产环境
- FACTORY_API_KEY=${FACTORY_API_KEY}
# 次优先级refresh token自动刷新机制
- DROID_REFRESH_KEY=${DROID_REFRESH_KEY}
# 可选如果需要修改端口在config.json中配置
# 阿里云日志服务配置
- ALIYUN_ACCESS_KEY_ID=${ALIYUN_ACCESS_KEY_ID}
- ALIYUN_ACCESS_KEY_SECRET=${ALIYUN_ACCESS_KEY_SECRET}
- ALIYUN_SLS_ENDPOINT=${ALIYUN_SLS_ENDPOINT}
- ALIYUN_SLS_PROJECT=${ALIYUN_SLS_PROJECT}
- ALIYUN_SLS_LOGSTORE=${ALIYUN_SLS_LOGSTORE}
volumes:
# 可选持久化auth.json以保存刷新的tokens
- ./data:/app/data
# 多账号配置文件(由 sync-accounts.sh 同步)
- ./accounts.json:/app/accounts.json:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Cloudflare Tunnel (可选)
# 需要在 .env 中设置 TUNNEL_TOKEN
tunnel:
image: cloudflare/cloudflared:latest
container_name: droid2api_tunnel
restart: unless-stopped
command: tunnel run
environment:
- TUNNEL_TOKEN=${TUNNEL_TOKEN}
depends_on:
- droid2api