Files
lcbp3/specs/04-Infrastructure-OPS/04-00-docker-compose/Desk-5439/ocr-sidecar/docker-compose.yml
T
admin ae1b1f35e1
CI / CD Pipeline / build (push) Successful in 4m51s
CI / CD Pipeline / deploy (push) Successful in 12m7s
feat(ai): ADR-032 Typhoon OCR integration - models, processors, cache, VRAM monitor, sandbox UI
2026-05-30 22:18:51 +07:00

61 lines
2.3 KiB
YAML

# File: specs/04-Infrastructure-OPS/04-00-docker-compose/Desk-5439/ocr-sidecar/docker-compose.yml
# Tesseract OCR 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
# - 2026-05-30: เพิ่ม OCR_LANG=tha+eng (Tesseract Thai + English)
# - 2026-05-30: เพิ่ม Typhoon OCR environment variables (T009b, ADR-032)
# OLLAMA_API_URL ชี้ไปที่ http://192.168.10.100:11434 (Admin Desktop LAN IP)
#
# วิธีรัน:
# docker compose up -d --build
#
# ทดสอบ:
# curl http://192.168.10.100: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"
OCR_LANG: "tha+eng" # Tesseract language code (Thai + English)
USE_GPU: "false" # OCR sidecar รันบน CPU, Typhoon OCR ใช้ Ollama แยก
# ─── Typhoon OCR via Ollama (ADR-032) ───────────────────────────────────
# ชี้ไปที่ Ollama ที่รันบน Desk-5439 ผ่าน LAN IP (ไม่ใช่ host.docker.internal)
OLLAMA_API_URL: "http://192.168.10.100:11434"
TYPHOON_OCR_MODEL: "scb10x/typhoon-ocr-3b"
# Timeout 120 วินาที/หน้า (budget สำหรับ 3B model บน RTX 2060 Super)
TYPHOON_OCR_TIMEOUT: "120"
volumes:
# Uploads จาก QNAP NAS ผ่าน CIFS (SMB) volume — Docker mount โดยตรง
- qnap_uploads:/mnt/uploads:ro
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:
qnap_uploads:
driver: local
driver_opts:
type: cifs
o: "username=${QNAP_USER},password=${QNAP_PASS},vers=3.0,uid=0,gid=0"
device: "//192.168.10.8/np-dms-as/data/uploads"