|
|
|
|
|
FROM node:18-alpine AS frontend-builder |
|
|
WORKDIR /app/frontend |
|
|
COPY frontend/package.json frontend/package-lock.json* ./ |
|
|
RUN npm install |
|
|
COPY frontend/ ./ |
|
|
ENV REACT_APP_BACKEND_URL=https://sibikrish-cr-agent.hf.space |
|
|
RUN npm run build |
|
|
|
|
|
|
|
|
FROM python:3.13-slim |
|
|
|
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \ |
|
|
PYTHONUNBUFFERED=1 \ |
|
|
PORT=7860 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
build-essential \ |
|
|
curl \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
COPY pyproject.toml . |
|
|
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip && \ |
|
|
pip install --no-cache-dir . |
|
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
|
COPY --from=frontend-builder /app/frontend/build ./frontend/build |
|
|
|
|
|
|
|
|
RUN mkdir -p uploads persistent_docs chroma_db |
|
|
|
|
|
|
|
|
|
|
|
RUN python ingest_persistent_docs.py |
|
|
|
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|
|