Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download Dockerfile from Ryaninaninorii/cuisync-ocr: direct link, hf CLI and curl.
- Browser
- Download file 812 Bytes
-
https://huggingface.co/spaces/Ryaninaninorii/cuisync-ocr/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Ryaninaninorii/cuisync-ocr/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Ryaninaninorii/cuisync-ocr/resolve/main/Dockerfile
812 Bytes
| FROM python:3.11-slim | |
| # Libraries OpenCV and Paddle need on Linux | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1 libglib2.0-0 libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Hugging Face runs the container as user 1000 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| PYTHONUNBUFFERED=1 \ | |
| PADDLE_PDX_DISABLE_MODEL_SOURCE_CHECK=True | |
| WORKDIR /home/user/app | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| COPY --chown=user . . | |
| # Download all the OCR models now, so waking the Space up doesn't have to | |
| RUN python -c "import ocr; ocr.warm_up()" | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "server:app", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "4", "--timeout", "300"] | |