Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +33 -0
Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# system deps required by opencv/paddle/others
|
| 7 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
+
build-essential \
|
| 9 |
+
git \
|
| 10 |
+
wget \
|
| 11 |
+
libgl1 \
|
| 12 |
+
libglib2.0-0 \
|
| 13 |
+
ffmpeg \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# copy requirements and app
|
| 17 |
+
COPY requirements.txt /app/requirements.txt
|
| 18 |
+
COPY app.py /app/app.py
|
| 19 |
+
|
| 20 |
+
# install pip requirements first (torch may come from default index)
|
| 21 |
+
RUN pip install --upgrade pip setuptools wheel
|
| 22 |
+
|
| 23 |
+
# install paddlepaddle CPU build first (as requested)
|
| 24 |
+
RUN pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/ || true
|
| 25 |
+
|
| 26 |
+
# install the rest
|
| 27 |
+
RUN pip install -r /app/requirements.txt
|
| 28 |
+
|
| 29 |
+
# ensure tmp dir exists and writable
|
| 30 |
+
RUN mkdir -p /tmp/ocr_app && chmod 1777 /tmp/ocr_app
|
| 31 |
+
|
| 32 |
+
EXPOSE 7860
|
| 33 |
+
CMD ["python", "app.py"]
|