File size: 868 Bytes
253b4cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.10-slim

ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app

# system deps required by opencv/paddle/others
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    git \
    wget \
    libgl1 \
    libglib2.0-0 \
    ffmpeg \
    && rm -rf /var/lib/apt/lists/*

# copy requirements and app
COPY requirements.txt /app/requirements.txt
COPY app.py /app/app.py

# install pip requirements first (torch may come from default index)
RUN pip install --upgrade pip setuptools wheel

# install paddlepaddle CPU build first (as requested)
RUN pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/ || true

# install the rest
RUN pip install -r /app/requirements.txt

# ensure tmp dir exists and writable
RUN mkdir -p /tmp/ocr_app && chmod 1777 /tmp/ocr_app

EXPOSE 7860
CMD ["python", "app.py"]