services:
  external-connector:
    build: ./external-connector
    container_name: external-connector
    restart: unless-stopped
    environment:
      BEAVER_BRIDGE_BASE_URL: ${BEAVER_BRIDGE_BASE_URL:-http://app-instance:8080}
      BEAVER_BRIDGE_TOKEN: ${BEAVER_BRIDGE_TOKEN}
      CONNECTOR_API_TOKEN: ${EXTERNAL_CONNECTOR_TOKEN}
      CONNECTOR_HOME: /var/lib/external-connector
      CONNECTOR_PUBLIC_BASE_URL: ${CONNECTOR_PUBLIC_BASE_URL:-http://localhost:8787}
      CONNECTOR_PROVIDER: ${CONNECTOR_PROVIDER:-vendor_cli}
      CONNECTOR_COMMAND_TIMEOUT_SECONDS: ${CONNECTOR_COMMAND_TIMEOUT_SECONDS:-120}
      WEIXIN_CONNECT_COMMAND: ${WEIXIN_CONNECT_COMMAND:-}
      WEIXIN_STATUS_COMMAND: ${WEIXIN_STATUS_COMMAND:-}
      WEIXIN_SEND_COMMAND: ${WEIXIN_SEND_COMMAND:-}
      FEISHU_CONNECT_COMMAND: ${FEISHU_CONNECT_COMMAND:-}
      FEISHU_STATUS_COMMAND: ${FEISHU_STATUS_COMMAND:-}
      FEISHU_SEND_COMMAND: ${FEISHU_SEND_COMMAND:-}
    volumes:
      - external-connector-state:/var/lib/external-connector
    ports:
      - "${EXTERNAL_CONNECTOR_PORT:-8787}:8787"
    networks:
      - beaver-instance-edge

volumes:
  external-connector-state:

networks:
  beaver-instance-edge:
    external: true
