| FROM python:3.10-slim | |
| # Install Tesseract and other dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| tesseract-ocr \ | |
| tesseract-ocr-ben \ | |
| libglib2.0-0 libsm6 libxrender1 libxext6 \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set Tesseract path explicitly | |
| ENV TESSERACT_PATH=/usr/bin/tesseract | |
| # Setup working directory | |
| WORKDIR /app | |
| # Copy the requirements.txt and the app.py into the container | |
| COPY requirements.txt . | |
| COPY app.py . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Run the application | |
| CMD ["python", "app.py"] | |