Download Dockerfile from dead031/ai-worker: direct link, hf CLI and curl.
- Browser
- Download file 915 Bytes
-
https://huggingface.co/spaces/dead031/ai-worker/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/dead031/ai-worker/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/dead031/ai-worker/resolve/main/Dockerfile
915 Bytes
| FROM python:3.10-slim | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| tesseract-ocr \ | |
| tesseract-ocr-mar \ | |
| tesseract-ocr-hin \ | |
| poppler-utils \ | |
| libgl1 \ | |
| libglx-mesa0 \ | |
| libglib2.0-0 \ | |
| git \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| # Install Torch for CPU first (to avoid dependency issues with detectron2) | |
| RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
| # Install Detectron2 with CPU flags | |
| RUN FORCE_CUDA=0 pip install --no-cache-dir 'git+https://github.com/facebookresearch/detectron2.git' | |
| # Install the rest of the requirements | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| # Hugging Face Spaces uses user 1000 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| CMD ["python", "app.py"] | |