Spaces:
Sleeping
Sleeping
Download Dockerfile from XDR-SAM/ai-source-classifier: direct link, hf CLI and curl.
- Browser
- Download file 820 Bytes
-
https://huggingface.co/spaces/XDR-SAM/ai-source-classifier/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/XDR-SAM/ai-source-classifier/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/XDR-SAM/ai-source-classifier/resolve/main/Dockerfile
820 Bytes
| # ββ Hugging Face Spaces compatible Dockerfile βββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim | |
| # HF Spaces runs as user 1000 β set this to avoid permission errors | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Add user's local bin to PATH | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Copy and install dependencies | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| # Download NLTK data | |
| RUN python -m nltk.downloader punkt punkt_tab | |
| # Copy app files | |
| COPY --chown=user main.py . | |
| COPY --chown=user model_compressed.joblib . | |
| # Hugging Face Spaces REQUIRES port 7860 | |
| EXPOSE 7860 | |
| # Run on port 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |