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