feat(ocr): 新增本地 OCR sidecar

This commit is contained in:
yml
2026-11-17 17:26:59 +08:00
parent a6eb6c95b9
commit 90addb80d5
166 changed files with 72858 additions and 34 deletions
+23
View File
@@ -0,0 +1,23 @@
# Local OCR sidecar
This service wraps the vendored `lxw112190/lw.PPOCR.C` runtime and the
PP-OCRv6 Tiny models behind the project's HTTP OCR API.
It is intentionally private:
- no host port is published in production;
- only the backend joins the Docker network path to `http://ocr:8787`;
- requests are P6 PPM images;
- the process runs as UID/GID `10001`.
The Go backend keeps its existing asynchronous OCR job contract and calls this
service only when `OCR_SERVICE_URL` is set. If the service is unavailable, the
admin upload flow still allows manually entering the group name.
Local verification:
```bash
docker compose -f deploy/docker-compose.dev.yml up -d --build ocr
curl -fsS http://127.0.0.1:18787/health
docker compose -f deploy/docker-compose.dev.yml logs -f ocr
```