services:
  ndc-beam-viewer:
    image: node:22-alpine
    working_dir: /beam/server
    command: node index.js
    restart: unless-stopped
    environment:
      PORT: "8080"
      NODEDC_BIM_AUTH_REQUIRED: "${NODEDC_BIM_AUTH_REQUIRED:-0}"
      NODEDC_BIM_PUBLIC_URL: "${NODEDC_BIM_PUBLIC_URL:-http://localhost:8080}"
      NODEDC_LAUNCHER_BASE_URL: "${NODEDC_LAUNCHER_BASE_URL:-http://localhost:5173}"
      NODEDC_LAUNCHER_INTERNAL_URL: "${NODEDC_LAUNCHER_INTERNAL_URL:-http://host.docker.internal:5173}"
      NODEDC_INTERNAL_ACCESS_TOKEN: "${NODEDC_INTERNAL_ACCESS_TOKEN:-}"
      NODEDC_BIM_ALLOWED_ORIGINS: "${NODEDC_BIM_ALLOWED_ORIGINS:-http://localhost:5173,http://localhost:8090}"
    ports:
      - "8080:8080"
    volumes:
      - ./:/beam

  nodedc-bim-converter:
    build:
      context: ./converter
    image: nodedc/bim-converter:local
    container_name: NodeDcBimConverter
    platform: linux/amd64
    restart: unless-stopped
    environment:
      NODEDC_BIM_CONVERTER_UPLOADS_DIR: /beam/uploads
      NODEDC_BIM_CONVERTER_INTERVAL_SECONDS: "10"
      NODEDC_BIM_CONVERTER_MAX_ATTEMPTS: "3"
      NODEDC_BIM_CONVERTER_TIMEOUT_SECONDS: "300"
      NODEDC_BIM_CONVERTER_XCAF_TIMEOUT_SECONDS: "1200"
      NODEDC_BIM_CONVERTER_CADQUERY_TIMEOUT_SECONDS: "1800"
    volumes:
      - ./server/data/uploads:/beam/uploads
