Download Dockerfile.space from minhbe65/RAG-api: direct link, hf CLI and curl.
- Browser
- Download file 757 Bytes
-
https://huggingface.co/spaces/minhbe65/RAG-api/resolve/main/Dockerfile.space
- Command line
-
hf download hf://spaces/minhbe65/RAG-api/Dockerfile.space
-
curl -L -o Dockerfile.space https://huggingface.co/spaces/minhbe65/RAG-api/resolve/main/Dockerfile.space
757 Bytes
| # Hugging Face Spaces Dockerfile (CPU, ~16 GB RAM free tier) | |
| # Build context: backend/ | |
| FROM python:3.12-slim | |
| WORKDIR /app | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONPATH=/app \ | |
| PORT=7860 \ | |
| # Dùng embedding model thật trên HF Spaces (đủ RAM) | |
| EMBEDDER=vie-v2 \ | |
| EMBED_DIM=1024 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential libpq-dev curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Cài đặt thư viện (bao gồm ML) | |
| COPY requirements.txt requirements-ml.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt -r requirements-ml.txt | |
| COPY . /app | |
| EXPOSE 7860 | |
| # HF Spaces dùng cổng 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |