Files
workphone-sdk/sdk/docker-compose.nas.yml
卡若 9118df9eee
Some checks failed
SDK CI / python-compile (push) Has been cancelled
feat: sdk agent、Android 与文档同步至 Gitea
- 新增 sdk/app/agent(Hook/Skills/Anti-ban 等)及 NAS/ADB 脚本
- 更新 Android 端、unified、PHP SDK、Docker Compose
- Soul 文档迁移至 Soul调研/;移除资料目录内 APK
- .gitignore 排除 sdk/tmp、sdk/logs、sdk/tmp_rom

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 18:20:14 +08:00

127 lines
3.5 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.

# 工作手机 SDK · 公司 NAS 一体化部署(不依赖宿主机 Mongo/Redis
# 用法:在 NAS 或已同步本目录的机器上执行
# docker compose -f docker-compose.nas.yml up -d --build
#
# 默认端口8880=网站(Nginx→SDK)8899=SDK API建议内网访问
# 访问http://<NAS_IP>:8880/hub
#
# 说明:
# - Mongo/Redis 仅加入 Docker 内网,不映射到宿主机公网端口,降低暴露面。
# - AI Brain 默认关闭;若公司有内网服务,设 AI_BRAIN_ENABLED=true 与 AI_BRAIN_API_URL。
# - 手机控制NAS 无 USB请用手机「无线调试 / adb tcpip」后在控制台或通过 adb connect 同一局域网设备。
services:
mongo:
image: mongo:7
container_name: workphone-mongo-nas
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin123
volumes:
- nas_workphone_mongo:/data/db
networks:
- workphone-nas
healthcheck:
test:
[
"CMD",
"mongosh",
"--quiet",
"mongodb://admin:admin123@127.0.0.1:27017/admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 10s
timeout: 5s
retries: 6
start_period: 40s
redis:
image: redis:7-alpine
container_name: workphone-redis-nas
restart: always
command: ["redis-server", "--appendonly", "yes"]
volumes:
- nas_workphone_redis:/data
networks:
- workphone-nas
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
workphone-sdk:
build:
context: .
dockerfile: Dockerfile
container_name: workphone-sdk-nas
restart: always
ports:
- "8899:8899"
environment:
- ENV=production
- MONGO_URI=mongodb://admin:admin123@mongo:27017/?authSource=admin
- MONGO_DB=workphone_sdk
- REDIS_URL=redis://redis:6379/1
- API_KEY=${API_KEY:-workphone-secret-key}
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY:-}
- ADB_SERVER_SOCKET=${ADB_SERVER_SOCKET:-}
- AI_BRAIN_ENABLED=${AI_BRAIN_ENABLED:-false}
- AI_BRAIN_API_URL=${AI_BRAIN_API_URL:-http://127.0.0.1:3102}
- AI_BRAIN_API_KEY=${AI_BRAIN_API_KEY:-}
- AI_BRAIN_DEFAULT_MODEL=${AI_BRAIN_DEFAULT_MODEL:-auto}
volumes:
- nas_workphone_data:/data
- nas_workphone_logs:/app/logs
# 工作台「开发文档」知识库:将 NAS 上的开发文档目录挂到容器内固定路径 /开发文档
# - /volume1/docker/workphone-docs/开发文档:/开发文档:ro
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_healthy
networks:
- workphone-nas
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8899/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 90s
logging:
driver: json-file
options:
max-size: "50m"
max-file: "3"
website:
build:
context: ./website
dockerfile: Dockerfile
container_name: workphone-website-nas
restart: always
ports:
- "8880:80"
depends_on:
workphone-sdk:
condition: service_healthy
networks:
- workphone-nas
logging:
driver: json-file
options:
max-size: "20m"
max-file: "2"
volumes:
nas_workphone_mongo:
nas_workphone_redis:
nas_workphone_data:
nas_workphone_logs:
networks:
workphone-nas:
name: workphone-nas-network