services:
  zhct-wecom-aibot:
    build:
      context: ../control/wecom-aibot
      dockerfile: Dockerfile.cloud
    image: zhct-wecom-aibot:cloud
    container_name: zhct-wecom-aibot
    restart: unless-stopped
    env_file:
      - /opt/zhct/local/wecom.env
    environment:
      TZ: Asia/Shanghai
      ZHCTPROMPT_ROOT: /workspace/zhct/zhctprompt
      WECOM_AIBOT_PYTHON: python3
      WECOM_AIBOT_CODEX_BIN: /usr/local/bin/codex
      WECOM_AIBOT_CODEX_MODEL: gpt-5.6-sol
      WECOM_AIBOT_CODEX_REASONING_EFFORT: low
      WECOM_AIBOT_CODEX_SERVICE_TIER: fast
      WECOM_AIBOT_CODEX_TIMEOUT_MS: 600000
      WECOM_AIBOT_HOST_CODEX_URL: ""
      WECOM_AIBOT_HOST_CODEX_TOKEN: ""
      WECOM_AIBOT_SAVE_FRAMES: "1"
      WECOM_AIBOT_VIDEO_ENABLED: "1"
      WECOM_AIBOT_VIDEO_MAX_BYTES: "20971520"
      WECOM_AIBOT_VIDEO_FRAME_COUNT: "6"
      WECOM_AIBOT_VIDEO_RETENTION_HOURS: "6"
      WECOM_AIBOT_IDENTITY_MAP: /workspace/zhct/local/wecom-identities.json
    volumes:
      - /opt/zhct:/workspace/zhct:ro
      - /opt/zhct/zhctprompt/work_wecom_customer_service:/workspace/zhct/zhctprompt/work_wecom_customer_service
      - /root/.codex:/root/.codex:ro
    working_dir: /workspace/zhct/zhctprompt
    healthcheck:
      test: ["CMD", "node", "/app/bot.js", "--check"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
