Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -6
Dockerfile
CHANGED
|
@@ -1,23 +1,31 @@
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Install system dependencies
|
|
|
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
|
|
| 5 |
gcc \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
# Set
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
# Copy requirements
|
| 12 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 13 |
RUN pip install --upgrade pip
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
-
# Copy
|
| 17 |
COPY app.py .
|
| 18 |
|
| 19 |
-
# Expose the port used by Gradio
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
#
|
| 23 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# Use an official Python 3.10 slim image as the base image.
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies
|
| 5 |
+
# - tesseract-ocr: for OCR text extraction
|
| 6 |
+
# - poppler-utils: for PDF to image conversion (used by pdf2image)
|
| 7 |
+
# - gcc: required to compile any C extensions
|
| 8 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
+
tesseract-ocr \
|
| 10 |
+
poppler-utils \
|
| 11 |
gcc \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Set the working directory in the container
|
| 15 |
WORKDIR /app
|
| 16 |
|
| 17 |
+
# Copy the requirements file first (so that dependency installation is cached)
|
| 18 |
COPY requirements.txt .
|
| 19 |
+
|
| 20 |
+
# Upgrade pip and install Python dependencies.
|
| 21 |
RUN pip install --upgrade pip
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
+
# Copy the rest of the application code into the container
|
| 25 |
COPY app.py .
|
| 26 |
|
| 27 |
+
# Expose the default port (7860) used by Gradio
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
# Define the command to run your app
|
| 31 |
CMD ["python", "app.py"]
|