Spaces:
Sleeping
Sleeping
Download Dockerfile from SirBallsXIV/DNN-Project: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/spaces/SirBallsXIV/DNN-Project/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/SirBallsXIV/DNN-Project/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/SirBallsXIV/DNN-Project/resolve/main/Dockerfile
1.62 kB
| # ============================================================================= | |
| # Stage 1: Build React Frontend | |
| # ============================================================================= | |
| FROM node:20-alpine AS frontend-builder | |
| WORKDIR /app/frontend | |
| COPY frontend/package*.json ./ | |
| RUN npm install | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| # ============================================================================= | |
| # Stage 2: Python Backend (CPU-only) with RAG | |
| # ============================================================================= | |
| FROM python:3.10-slim | |
| ENV PYTHONUNBUFFERED=1 DEBIAN_FRONTEND=noninteractive | |
| WORKDIR /app | |
| # Install system deps and Python packages in one layer | |
| RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/* && \ | |
| pip install --no-cache-dir --upgrade pip setuptools wheel && \ | |
| pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \ | |
| pip install --no-cache-dir transformers accelerate scipy bitsandbytes peft fastapi uvicorn pydantic python-multipart && \ | |
| pip install --no-cache-dir langchain==0.1.0 langchain-community==0.0.20 chromadb==0.4.22 sentence-transformers==2.3.1 pypdf==4.1.0 pymupdf==1.23.26 requests==2.31.0 | |
| # Copy code (including ingest script) | |
| COPY backend/ /app/backend/ | |
| COPY --from=frontend-builder /app/frontend/dist /app/dist | |
| # Create directories for docs and vectorstore | |
| RUN mkdir -p /app/backend/docs /app/backend/vectorstore | |
| WORKDIR /app/backend | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |