Spaces:
Runtime error
Runtime error
File size: 872 Bytes
3ac452f 8762287 3ac452f |
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 33 34 35 36 37 |
# Use an official Python base image
FROM python:3.10-slim
# Set environment variables to avoid prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies for OCR (Tesseract) and other libraries
RUN apt-get update && apt-get install -y \
tesseract-ocr \
libtesseract-dev \
libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/*
# Ensure Tesseract is in the PATH - include both possible locations
ENV PATH="/usr/bin:/usr/local/bin:${PATH}"
# Verify Tesseract installation
RUN tesseract --version
# Set working directory
WORKDIR /app
# Copy the requirements file
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application files
COPY . .
# Expose the port Gradio uses (default is 7860)
EXPOSE 7860
# Run the application
CMD ["python", "app.py"]
|