Download Dockerfile from berohan/studyrag: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/berohan/studyrag/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/berohan/studyrag/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/berohan/studyrag/resolve/main/Dockerfile
1.2 kB
| # ---- frontend build stage ---- | |
| FROM node:22-slim AS frontend-build | |
| WORKDIR /frontend | |
| COPY frontend/package.json frontend/package-lock.json ./ | |
| RUN npm ci | |
| COPY frontend/ . | |
| RUN npm run build | |
| # ---- python runtime stage ---- | |
| FROM python:3.12-slim | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gcc \ | |
| g++ \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY --chown=user:user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| COPY --chown=user:user . . | |
| COPY --from=frontend-build --chown=user:user /frontend/dist ./static | |
| RUN mkdir -p uploads chroma_store .cache/huggingface && \ | |
| chown -R user:user /app | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| HF_HOME=/app/.cache/huggingface | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/status', timeout=3)" || exit 1 | |
| CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |