ui-convert2 / Dockerfile
chriswang09's picture
check ocr
8762287
raw
history blame contribute delete
872 Bytes
# 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"]