Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
|
@@ -1,19 +1,24 @@
|
|
| 1 |
FROM python:3.11-slim
|
|
|
|
| 2 |
ENV PYTHONUNBUFFERED=1
|
| 3 |
|
| 4 |
-
RUN apt-get update && apt-get install -y
|
| 5 |
-
poppler-utils tesseract-ocr build-essential curl
|
|
|
|
| 6 |
|
| 7 |
WORKDIR /app
|
| 8 |
COPY requirements.txt /app/requirements.txt
|
|
|
|
|
|
|
| 9 |
RUN pip install --upgrade pip setuptools wheel
|
| 10 |
|
| 11 |
-
# Install torch CPU wheel
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
# Then install
|
| 15 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 16 |
|
| 17 |
COPY . /app
|
| 18 |
EXPOSE 7860
|
| 19 |
-
CMD ["python3", "app.py"]
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
ENV PYTHONUNBUFFERED=1
|
| 4 |
|
| 5 |
+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
| 6 |
+
poppler-utils tesseract-ocr libtesseract-dev build-essential curl \
|
| 7 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
COPY requirements.txt /app/requirements.txt
|
| 11 |
+
|
| 12 |
+
# Upgrade pip/tools so the resolver can find manylinux wheels
|
| 13 |
RUN pip install --upgrade pip setuptools wheel
|
| 14 |
|
| 15 |
+
# Install a torch CPU wheel that definitely exists for py3.11.
|
| 16 |
+
# Try 2.9.0+cpu first; if you want 2.9.1 try 2.9.0, then switch version if needed.
|
| 17 |
+
RUN pip install --no-cache-dir torch==2.9.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
|
| 18 |
|
| 19 |
+
# Then install remaining Python deps (ensure requirements does NOT include 'torch')
|
| 20 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 21 |
|
| 22 |
COPY . /app
|
| 23 |
EXPOSE 7860
|
| 24 |
+
CMD ["python3", "app.py"]
|