Spaces:
Sleeping
Sleeping
Download Dockerfile from Emaiiolh/Hate-function: direct link, hf CLI and curl.
- Browser
- Download file 792 Bytes
-
https://huggingface.co/spaces/Emaiiolh/Hate-function/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Emaiiolh/Hate-function/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Emaiiolh/Hate-function/resolve/main/Dockerfile
792 Bytes
| FROM python:3.10-slim | |
| # Set environment variables for Hugging Face cache | |
| # Before running your app | |
| ENV HF_HOME=/app/hf_cache | |
| ENV TRANSFORMERS_CACHE=/app/hf_cache | |
| ENV XDG_CACHE_HOME=/app/hf_cache | |
| RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache | |
| # Create working directory | |
| WORKDIR /code | |
| # System dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| wget \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python packages | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # Copy app code | |
| COPY . . | |
| # Create model cache directory | |
| RUN mkdir -p /code/hf_cache | |
| # Expose FastAPI port | |
| EXPOSE 7860 | |
| # Start the app | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |