Spaces:
Sleeping
Sleeping
Download Dockerfile from CieLZ/upload-ocr: direct link, hf CLI and curl.
- Browser
- Download file 731 Bytes
-
https://huggingface.co/spaces/CieLZ/upload-ocr/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/CieLZ/upload-ocr/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/CieLZ/upload-ocr/resolve/main/Dockerfile
731 Bytes
| # Hugging Face Spaces Dockerfile | |
| FROM python:3.11-slim | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Install sistem dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| git build-essential && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Install dependencies sebagai root | |
| COPY requirements.txt /tmp/requirements.txt | |
| RUN pip install --no-cache-dir -r /tmp/requirements.txt | |
| # Buat user dengan UID 1000 | |
| RUN useradd -m -u 1000 user | |
| # Switch ke user dan setup home directory | |
| USER user | |
| ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH | |
| # Working directory di home user (writable) | |
| WORKDIR $HOME/app | |
| # Copy app dengan ownership yang benar | |
| COPY --chown=user . $HOME/app | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] |