Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +18 -6
Dockerfile
CHANGED
|
@@ -4,21 +4,33 @@ FROM python:3.11-slim
|
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
# Set a writable cache directory for Hugging Face models to solve permission errors
|
| 9 |
ENV HF_HOME=/tmp/.cache/huggingface
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Copy the requirements file into the container
|
| 12 |
COPY ./requirements.txt /code/requirements.txt
|
| 13 |
|
| 14 |
-
# Install
|
| 15 |
-
RUN pip install --no-cache-dir --upgrade
|
|
|
|
| 16 |
|
| 17 |
-
# Copy the rest of your app's code
|
| 18 |
COPY . /code/
|
| 19 |
|
| 20 |
# Expose the port the app runs on
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
# Command to run the uvicorn server for FastAPI
|
| 24 |
-
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
+
# Set a writable cache directory for Hugging Face models
|
|
|
|
| 8 |
ENV HF_HOME=/tmp/.cache/huggingface
|
| 9 |
|
| 10 |
+
# --- Install system dependencies including tesseract-ocr ---
|
| 11 |
+
RUN apt-get update && \
|
| 12 |
+
apt-get install -y --no-install-recommends \
|
| 13 |
+
tesseract-ocr \
|
| 14 |
+
libgl1 \
|
| 15 |
+
poppler-utils \
|
| 16 |
+
libglib2.0-0 \
|
| 17 |
+
libsm6 \
|
| 18 |
+
libxrender1 \
|
| 19 |
+
libxext6 \
|
| 20 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
+
|
| 22 |
# Copy the requirements file into the container
|
| 23 |
COPY ./requirements.txt /code/requirements.txt
|
| 24 |
|
| 25 |
+
# Install Python packages
|
| 26 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 27 |
+
pip install --no-cache-dir -r /code/requirements.txt
|
| 28 |
|
| 29 |
+
# Copy the rest of your app's code
|
| 30 |
COPY . /code/
|
| 31 |
|
| 32 |
# Expose the port the app runs on
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
# Command to run the uvicorn server for FastAPI
|
| 36 |
+
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|