# File: specs/04-Infrastructure-OPS/04-00-docker-compose/Desk-5439/ocr-sidecar/docker-compose.yml # PaddleOCR Sidecar — รันบน Desk-5439 (AI Isolation Host) ตาม ADR-023A # Change Log: # - 2026-05-25: Initial compose file สำหรับ PaddleOCR HTTP sidecar # - 2026-05-25: แก้ volumes ให้ถูกต้องสำหรับ Windows + Docker Desktop # # วิธีรัน: # docker compose up -d --build # # ทดสอบ: # curl http://localhost:8765/health name: lcbp3-ocr services: ocr-sidecar: build: context: . dockerfile: Dockerfile container_name: ocr-sidecar restart: unless-stopped ports: - "8765:8765" environment: OCR_CHAR_THRESHOLD: "100" OCR_PORT: "8765" OCR_MAX_PAGES: "0" # ตั้ง USE_GPU=true เพื่อใช้ RTX 2060 Super (ต้องติดตั้ง nvidia-container-toolkit) USE_GPU: "false" volumes: # Model cache — Docker named volume เพื่อไม่ต้อง download ใหม่ทุกครั้ง - paddleocr_models:/root/.paddleocr # Uploads จาก QNAP NAS ผ่าน SMB mapped drive Z: # ก่อนรัน: net use Z: \\192.168.10.8\np-dms-as /persistent:yes # แล้วเปิด Docker Desktop → Settings → Resources → File Sharing → เพิ่ม Z:\ - type: bind source: Z:\data\uploads target: /mnt/uploads read_only: true logging: driver: "json-file" options: max-size: "10m" max-file: "3" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8765/health"] interval: 30s timeout: 10s retries: 3 start_period: 60s volumes: paddleocr_models: name: paddleocr_models