Spaces:
Sleeping
Sleeping
Download Dockerfile from prafulla2121/my-ocr-api: direct link, hf CLI and curl.
- Browser
- Download file 692 Bytes
-
https://huggingface.co/spaces/prafulla2121/my-ocr-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/prafulla2121/my-ocr-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/prafulla2121/my-ocr-api/resolve/main/Dockerfile
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"] | |