使用 Docker Compose 一键部署 OpenClaw 网关,并接入阿里云百炼模型。

一、docker-compose.yml

services:
  openclaw:
    image: docker.xuanyuan.run/alpine/openclaw:latest
    container_name: openclaw
    ports:
      - "18789:18789"
    volumes:
      - ./openclaw:/home/node/.openclaw
    environment:
      - TZ=Asia/Shanghai
      - OPENCLAW_GATEWAY_PASSWORD=******
    restart: unless-stopped
    command: openclaw gateway --port 18789 --allow-unconfigured

二、openclaw.json

{
  "gateway": {
    "port": 18789,
    "bind": "lan",
    "auth": {
      "mode": "token",
      "token": "******"
    },
    "controlUi": {
      "allowInsecureAuth": true,
      "dangerouslyDisableDeviceAuth": true
    }
  },
  "meta": {
    "lastTouchedVersion": "2026.6.9",
    "lastTouchedAt": "2026-06-23T06:35:27.062Z"
  },
  "models": {
    "providers": {
      "alibaba": {
        "models": [
          { "id": "qwen3.7-plus", "input": [], "name": "千问3.7-plus" },
          { "id": "deepseek-v4-flash", "input": [], "name": "deepseek-v4-flash" },
          { "id": "qwen3.7-max", "input": [], "name": "通义千问 Max" }
        ],
        "apiKey": "sk-******",
        "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1"
      }
    },
    "mode": "replace"
  }
}

安全提示:原文中的网关密码、访问 Token 与阿里云 API Key 均为敏感信息,发布时已做脱敏处理(******)。请勿将真实密钥发布到公网,如已泄露请尽快在控制台轮换。