From b0bb20e5893d0acedfbdc287e136c52ab5abe9b5 Mon Sep 17 00:00:00 2001 From: yml Date: Tue, 17 Nov 2026 17:32:34 +0800 Subject: [PATCH] =?UTF-8?q?build(ocr):=20=E7=B2=BE=E7=AE=80=20OCR=20sideca?= =?UTF-8?q?r=20=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/ocr/Dockerfile | 13 ++++--------- deploy/ocr/README.md | 3 +++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/deploy/ocr/Dockerfile b/deploy/ocr/Dockerfile index d1d5eaaa..f50ef643 100644 --- a/deploy/ocr/Dockerfile +++ b/deploy/ocr/Dockerfile @@ -1,15 +1,13 @@ # syntax=docker/dockerfile:1.7 -FROM ubuntu:24.04 AS build +# The sidecar is fully containerized; the host OS only needs to run Docker. +FROM debian:bookworm-slim AS build ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get install -y --no-install-recommends \ + build-essential \ cmake \ - g++ \ - gcc \ - libc6-dev \ - make \ && rm -rf /var/lib/apt/lists/* WORKDIR /src @@ -32,15 +30,12 @@ RUN cmake -S . -B build \ -pthread -lm \ -o /out/lw-http-ocr -FROM ubuntu:24.04 +FROM debian:bookworm-slim ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get install -y --no-install-recommends \ - ca-certificates \ curl \ - libc6 \ - libgcc-s1 \ libstdc++6 \ tzdata \ && rm -rf /var/lib/apt/lists/* \ diff --git a/deploy/ocr/README.md b/deploy/ocr/README.md index a5dd1907..1a54980e 100644 --- a/deploy/ocr/README.md +++ b/deploy/ocr/README.md @@ -3,6 +3,9 @@ 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 a self-contained Debian slim Docker image. The production host does not +need Ubuntu packages, a compiler, Python, PaddleOCR, or the OCR models installed. + It is intentionally private: - no host port is published in production;