bash# 确保在项目根目录
cd deep_research
# 检查 Docker 是否运行
docker info
# 确保已登录 Docker Hub
docker login
bash# 方法一:使用脚本自动构建(推荐)
./build-slim.sh
# 方法二:指定构建Linux 版本
## MacOS (ARM架构)
TARGET_PLATFORM=linux/arm64 ./build-slim.sh
## Linux (x86架构)
TARGET_PLATFORM=linux/amd64 ./build-slim.sh
# 方法三:手动构建 Linux 版本
docker build --platform=linux/amd64 \
    --build-arg BUILDPLATFORM=linux/amd64 \
    --build-arg TARGETPLATFORM=linux/amd64 \
    -t golovin0623/deep-research:amd64-slim \
    -f Dockerfile.slim .
bash# 查看镜像大小
docker images | grep deep-research
# 测试镜像
docker run --rm golovin0623/deep-research:amd64-slim python --version
bash# 推送到 Docker Hub
docker push golovin0623/deep-research:amd64-slim
bash# 安装 Docker(如果未安装)
curl -fsSL https://get.docker.com | sh
# 安装 Docker Compose(如果未安装)
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# 创建项目目录
mkdir -p /root/deep_research
cd /root/deep_research
bash# 创建配置文件
cat > config.json << EOF
{
    "ARK_API_KEY": "您的真实API密钥",
    "REASONING_MODEL": "deepseek-r1-250120",
    "SEARCH_ENGINE": "volc_bot",
    "SEARCH_BOT_ID": "您的SEARCH_BOT_ID",
    "API_ADDR": "http://server:8888/api/v3/bots",
    "API_BOT_ID": "您的API_BOT_ID",
    "SEARCH_MAX_RETRIES": 3,
    "SEARCH_INITIAL_BACKOFF": 1.0,
    "SEARCH_BACKOFF_FACTOR": 2.0,
    "MAX_PLANNING_ROUNDS": 5,
    "MAX_SEARCH_WORDS": 5
}
EOF
# 创建环境变量文件
cat > .env << EOF
ARK_API_KEY=您的真实API密钥
SEARCH_BOT_ID=您的SEARCH_BOT_ID
API_ADDR=http://server:8888/api/v3/bots
API_BOT_ID=您的API_BOT_ID
REASONING_MODEL=deepseek-r1-250120
SEARCH_ENGINE=volc_bot
PLATFORM=linux/amd64
IMAGE_TAG=amd64-slim
PORT_SERVER=8890
PORT_WEBUI=7861
EOF
bash# 创建 docker-compose.slim.yml
cat > docker-compose.slim.yml << EOF
version: '3'
services:
  server:
    image: golovin0623/deep-research:\${IMAGE_TAG:-amd64-slim}
    platform: \${PLATFORM:-linux/amd64}
    command: python -m server
    volumes:
      - ./config.json:/app/config.json
    ports:
      - "\${PORT_SERVER:-8890}:8888"
    networks:
      - deep-research-network
    restart: unless-stopped
    environment:
      - ARK_API_KEY=\${ARK_API_KEY}
      - SEARCH_BOT_ID=\${SEARCH_BOT_ID}
      - REASONING_MODEL=\${REASONING_MODEL}
      - SEARCH_ENGINE=\${SEARCH_ENGINE}
      - SEARCH_MAX_RETRIES=\${SEARCH_MAX_RETRIES:-3}
      - SEARCH_INITIAL_BACKOFF=\${SEARCH_INITIAL_BACKOFF:-1.0}
      - SEARCH_BACKOFF_FACTOR=\${SEARCH_BACKOFF_FACTOR:-2.0}
      - APP_MODE=server
  webui:
    image: golovin0623/deep-research:\${IMAGE_TAG:-amd64-slim}
    platform: \${PLATFORM:-linux/amd64}
    command: python -m webui
    volumes:
      - ./config.json:/app/config.json
    ports:
      - "\${PORT_WEBUI:-7861}:7860"
    depends_on:
      - server
    networks:
      - deep-research-network
    restart: unless-stopped
    environment:
      - API_ADDR=\${API_ADDR:-http://server:8888/api/v3/bots}
      - ARK_API_KEY=\${ARK_API_KEY}
      - API_BOT_ID=\${API_BOT_ID}
      - REASONING_MODEL=\${REASONING_MODEL}
      - SEARCH_ENGINE=\${SEARCH_ENGINE}
      - APP_MODE=webui
networks:
  deep-research-network:
    driver: bridge
EOF
bash# 拉取镜像
docker pull golovin0623/deep-research:amd64-slim
# 启动服务
docker-compose -f docker-compose.slim.yml up -d
bash# 检查容器状态
docker ps
# 查看服务日志
docker-compose -f docker-compose.slim.yml logs -f
http://服务器IP:7861http://服务器IP:8890bash# 使用curl测试API
curl -X POST http://localhost:8890/api/v3/bots \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer 您的ARK_API_KEY" \
  -d '{"messages":[{"role":"user","content":"测试消息"}]}'
bash# 停止服务
docker-compose -f docker-compose.slim.yml down
# 重启服务
docker-compose -f docker-compose.slim.yml restart
# 更新服务
docker-compose -f docker-compose.slim.yml pull
docker-compose -f docker-compose.slim.yml up -d
bash# 查看所有服务日志
docker-compose -f docker-compose.slim.yml logs -f
# 查看特定服务日志
docker-compose -f docker-compose.slim.yml logs -f server
docker-compose -f docker-compose.slim.yml logs -f webui
bash# 查看容器状态
docker ps -a | grep deep-research
# 进入容器
docker exec -it deep_research_server_1 /bin/sh
docker exec -it deep_research_webui_1 /bin/sh
服务无法启动
netstat -tulpn | grep -E '8890|7861'docker-compose -f docker-compose.slim.yml logschmod 644 config.jsonAPI连接失败
curl -v http://localhost:8890镜像拉取失败
docker pull golovin0623/deep-research:amd64-slimbash# 查看容器资源使用情况
docker stats
# 查看系统资源使用情况
top
htop  # 如果已安装
配置文件安全
chmod 600 config.json网络安全
容器安全
需要任何具体步骤的详细说明吗?