File size: 1,157 Bytes
6417130
2577228
6417130
 
 
 
 
4df8b27
6417130
 
 
 
 
 
 
 
 
 
 
 
 
c81c228
 
61aabfc
6417130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e3c573d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 & Cham-SVTR V24 default model
RUN echo "Cache bust 2026-09-16T11:40:00Z - Temporarily hide V25, set V24 as default model"

# 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"]