services: openclaw-gateway: image: ${OPENCLAW_IMAGE:-openclaw:local} # [修正] 使用 .env 中的 HOST_UID 執行,解決權限問題 user: "${HOST_UID:-1000}:${HOST_GID:-1000}" environment: OPENCLAW_GATEWAY_TOKEN: ${OPENCLAW_GATEWAY_TOKEN} HOME: /home/node GOG_CONFIG_DIR: /home/node/.config/gog TERM: xterm-256color CLAUDE_AI_SESSION_KEY: ${CLAUDE_AI_SESSION_KEY:-} CLAUDE_WEB_SESSION_KEY: ${CLAUDE_WEB_SESSION_KEY:-} CLAUDE_WEB_COOKIE: ${CLAUDE_WEB_COOKIE:-} volumes: - ${OPENCLAW_CONFIG_DIR}:/home/node/.openclaw - ${OPENCLAW_WORKSPACE_DIR}:/home/node/.openclaw/workspace ports: - "${OPENCLAW_GATEWAY_PORT:-18789}:18789" - "${OPENCLAW_BRIDGE_PORT:-18790}:18790" init: true restart: unless-stopped command: [ "node", "dist/index.js", "gateway", "--bind", "${OPENCLAW_GATEWAY_BIND:-lan}", "--port", "${OPENCLAW_GATEWAY_PORT:-18789}", ] openclaw-cli: image: ${OPENCLAW_IMAGE:-openclaw:local} # [修正] CLI 也使用相同權限 user: "${HOST_UID:-1000}:${HOST_GID:-1000}" # [修正] 確保進入點正確,這樣後面接 "onboard" 參數才有效 entrypoint: ["node", "dist/index.js"] environment: OPENCLAW_GATEWAY_TOKEN: ${OPENCLAW_GATEWAY_TOKEN} HOME: /home/node TERM: xterm-256color volumes: - ${OPENCLAW_CONFIG_DIR}:/home/node/.openclaw - ${OPENCLAW_WORKSPACE_DIR}:/home/node/.openclaw/workspace stdin_open: true tty: true