Download Dockerfile from Wized2/OCR: direct link, hf CLI and curl.
- Browser
- Download file 661 Bytes
-
https://huggingface.co/spaces/Wized2/OCR/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Wized2/OCR/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Wized2/OCR/resolve/main/Dockerfile
661 Bytes
| # 1. Use the official light Python image | |
| FROM python:3.10-slim | |
| # 2. Install modern system libraries required by OpenCV / EasyOCR | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 3. Set the directory path inside the container | |
| WORKDIR /code | |
| # 4. Copy and install your Python dependencies | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # 5. Copy your application script | |
| COPY ./app.py /code/app.py | |
| # 6. Run the API on port 7860 (Hugging Face's mandatory web port) | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |