Spaces:
Sleeping
Sleeping
File size: 1,100 Bytes
0ba244a 4adee1f 4e3c340 0ba244a 4adee1f 0ba244a 4adee1f 0ba244a 4adee1f 0ba244a 4adee1f 0ba244a 4e3c340 |
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 |
# Use an official Python runtime as a parent image
FROM python:3.12-slim
# --- ADDED: Install Tesseract OCR Engine ---
# First, update the package lists. Then, install Tesseract and its English language pack.
# The `-y` flag auto-confirms the installation.
# Cleaning up the apt cache (`rm -rf ...`) keeps the final Docker image smaller.
RUN apt-get update && apt-get install -y \
tesseract-ocr \
&& rm -rf /var/lib/apt/lists/*
# --- END OF ADDED SECTION ---
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the application's code into the container
COPY . .
# Make port 7860 available to the world outside this container
EXPOSE 7860
# Command to run the application using Gunicorn
# This is a robust way to run FastAPI/Flask in production.
CMD ["gunicorn", "--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:7860", "app:app"]
|