# PaddleOCR as an HTTP API: docker compose up, then POST to http://localhost:8080/ocr
# (brasspage.com/paddleocr-docker/, Nov 18, 2026)
services:
  paddleocr:
    build: .
    # On arm64 the API process crashed (SIGSEGV) on the first request; amd64 worked, under Rosetta on a Mac
    platform: linux/amd64
    entrypoint: ["paddlex", "--serve", "--pipeline", "OCR", "--device", "cpu"]
    ports:
      - "127.0.0.1:8080:8080"
    volumes:
      - paddlex:/root/.paddlex
    cpus: 2
volumes:
  paddlex:
