Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +0 -10
Dockerfile
CHANGED
|
@@ -2,7 +2,6 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
git ffmpeg libsm6 libxext6 \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
|
@@ -10,18 +9,9 @@ RUN apt-get update && apt-get install -y \
|
|
| 10 |
COPY requirements.txt .
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Set huggingface cache to inside /app
|
| 14 |
ENV HF_HOME=/app/.cache/huggingface
|
| 15 |
-
|
| 16 |
-
# Ensure the cache directory exists and is writable
|
| 17 |
RUN mkdir -p /app/.cache/huggingface && chmod -R 777 /app/.cache
|
| 18 |
|
| 19 |
-
# Pre-download the model so runtime is offline-ready
|
| 20 |
-
RUN python -c "from transformers import TrOCRProcessor, VisionEncoderDecoderModel; \
|
| 21 |
-
TrOCRProcessor.from_pretrained('microsoft/trocr-base-printed'); \
|
| 22 |
-
VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-base-printed')"
|
| 23 |
-
|
| 24 |
-
# Copy source code
|
| 25 |
COPY src/ ./src/
|
| 26 |
|
| 27 |
EXPOSE 7860
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
git ffmpeg libsm6 libxext6 \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
| 9 |
COPY requirements.txt .
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
|
|
|
| 12 |
ENV HF_HOME=/app/.cache/huggingface
|
|
|
|
|
|
|
| 13 |
RUN mkdir -p /app/.cache/huggingface && chmod -R 777 /app/.cache
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
COPY src/ ./src/
|
| 16 |
|
| 17 |
EXPOSE 7860
|