Download Dockerfile from NimrodDev/RAG_SPACE: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/spaces/NimrodDev/RAG_SPACE/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/NimrodDev/RAG_SPACE/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/NimrodDev/RAG_SPACE/resolve/main/Dockerfile
1.17 kB
| # ---------- Base ---------- | |
| FROM python:3.11-slim | |
| # ---------- Environment Setup ---------- | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV HF_HOME=/code/.cache/huggingface | |
| ENV TRANSFORMERS_CACHE=/code/.cache/huggingface | |
| ENV TORCH_HOME=/code/.cache/torch | |
| # ---------- System Dependencies ---------- | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| git \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ---------- Working Directory ---------- | |
| WORKDIR /code | |
| # ---------- Install Python Dependencies ---------- | |
| COPY requirements.txt . | |
| RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt | |
| # ---------- Pre-Download Embedding Model ---------- | |
| COPY pre_download.py . | |
| RUN python pre_download.py | |
| # ---------- Copy Application Code ---------- | |
| COPY . . | |
| # ---------- Ensure FAISS and Cache Dirs Exist ---------- | |
| RUN mkdir -p /code/faiss_db /code/.cache && chmod -R 777 /code/faiss_db /code/.cache | |
| # ---------- Expose Web Port ---------- | |
| EXPOSE 7860 | |
| # ---------- Start the App ---------- | |
| CMD ["gunicorn", "app:app", "-b", "0.0.0.0:7860", "--timeout", "300"] | |