File size: 687 Bytes
2438b27 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Hugging Face Spaces (Docker SDK) — serves the FastAPI backend on port 7860.
# Build context is the repo root; only RAG_Products/ is needed.
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential && rm -rf /var/lib/apt/lists/*
COPY RAG_Products/requirements.txt ./RAG_Products/requirements.txt
RUN pip install --no-cache-dir -r RAG_Products/requirements.txt
COPY RAG_Products ./RAG_Products
# Build the FAISS index into the image so the Space starts ready to serve.
RUN python -m RAG_Products.ingest
ENV PORT=7860
EXPOSE 7860
CMD ["sh", "-c", "uvicorn RAG_Products.api:app --host 0.0.0.0 --port ${PORT:-7860}"]
|