services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: gnommo-osint-board
    restart: unless-stopped
    environment:
      NODE_ENV: production
      PORT: 8787
      # Internal: reach gu_common services by their docker hostnames over plain HTTP.
      DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@gnommo-db:5432/${POSTGRES_DB}
      # Public: the frontend is served over TLS at gupi.glitch.university by the proxy.
      CORS_ORIGIN: ${CORS_ORIGIN:-https://gupi.${DOMAIN}}
      JWT_SECRET: ${JWT_SECRET}
      LEVEL_EDITING_ENABLED: ${LEVEL_EDITING_ENABLED:-false}
      MAX_DOCUMENT_BYTES: ${MAX_DOCUMENT_BYTES:-26214400}
      OCR_ENABLED: ${OCR_ENABLED:-true}
      OCR_LANGUAGES: ${OCR_LANGUAGES:-nor+eng}
      OCR_TIMEOUT_MS: ${OCR_TIMEOUT_MS:-20000}
      MAX_OCR_BYTES: ${MAX_OCR_BYTES:-15728640}
      MAX_EXTRACTED_TEXT_CHARACTERS: ${MAX_EXTRACTED_TEXT_CHARACTERS:-200000}
      EVIDENCE_JUDGE_PROVIDER: ${EVIDENCE_JUDGE_PROVIDER:-disabled}
      EVIDENCE_JUDGE_MODEL: ${EVIDENCE_JUDGE_MODEL:-}
      EVIDENCE_JUDGE_VERSION: ${EVIDENCE_JUDGE_VERSION:-evidence_claim_v1}
      EVIDENCE_JUDGE_TIMEOUT_MS: ${EVIDENCE_JUDGE_TIMEOUT_MS:-10000}
      EVIDENCE_JUDGE_MAX_CHARACTERS: ${EVIDENCE_JUDGE_MAX_CHARACTERS:-20000}
      ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
      S3_ENDPOINT: http://gnommo-minio:9000
      S3_REGION: ${S3_REGION:-us-east-1}
      S3_ACCESS_KEY: ${MINIO_ROOT_USER}
      S3_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
      S3_BUCKET: ${OSINT_S3_BUCKET:-osint-evidence}
      S3_FORCE_PATH_STYLE: "true"
    expose:
      - "8787"
    networks:
      - default
      - gnommo

networks:
  default: {}
  gnommo:
    external: true
