Spaces:
Running

cham-ocr-studio / Dockerfile
phucsd's picture
Deploy Cham-OCR V26.3: Sparse Negative Polarity, Short-Header 2-Col Order, Symmetric Inline Router v2.4, Legacy LRU & Studio JSON Re-Import Fix
a67d1cc verified
Raw History Blame Contribute Delete
1.26 kB
FROM python:3.11-slim
# Rebuild timestamp: 2026-08-01T09:26:20Z - Re-assign components using true_core_coords for full line bbox height [30..78]
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies required for OpenCV, PaddlePaddle, and OpenMP
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
libgl1 \
libglib2.0-0 \
libgomp1 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements and install python packages
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Force cache bust for updated app code & Pipeline v26.3.2 + Studio Auto-Retry + Short 2-Col + Sparse Corner Negative
RUN echo "Cache bust 2026-11-23T10:30:00Z - Cham-OCR Studio: Pipeline v26.3.2 + Short 2x2 Grid + Scale-Invariant Negative + Valley/Adaptive Trim"
# Copy application files
COPY . /app
# Environment variables for CPU optimization & HF Spaces port
ENV PORT=7860
ENV CPU_THREADS=1
ENV ENABLE_MKLDNN=False
ENV OMP_NUM_THREADS=1
ENV MKL_NUM_THREADS=1
ENV KMP_DUPLICATE_LIB_OK=TRUE
ENV PYTHONUNBUFFERED=1
# Expose Hugging Face Space default port
EXPOSE 7860
# Run Cham OCR Studio
CMD ["python", "-u", "ocr-studio/app.py"]