my-ocr-api / Dockerfile
prafulla2121's picture
Upload 3 files
e256de7 verified
Raw History Blame Contribute Delete
692 Bytes
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /code
# Install system dependencies (Tesseract OCR)
RUN apt-get update && apt-get install -y \
tesseract-ocr \
libtesseract-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy the requirements file into the container
COPY ./requirements.txt /code/requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the rest of the application code
COPY . .
# Command to run the FastAPI app
# Note: Hugging Face uses port 7860 by default
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]