Research-Paper-RAG-chatbot / docker /Dockerfile.backend
salvirezwan's picture
Initial commit: Academic Research RAG project
8ec547b
Raw
History Blame Contribute Delete
931 Bytes
# =============================================================
# Backend Dockerfile β€” FastAPI + uv
# =============================================================
FROM python:3.11-slim
# System deps:
# libmagic1 β€” required by python-magic (Unstructured)
# poppler-utils β€” required by pdf2image / PyMuPDF fallback
# libgl1 β€” required by some sentence-transformers wheels
RUN apt-get update && apt-get install -y --no-install-recommends \
libmagic1 \
poppler-utils \
libgl1 \
&& rm -rf /var/lib/apt/lists/*
# Install uv (fast Python package manager)
RUN pip install uv
WORKDIR /app
# Copy dependency manifest first to leverage layer caching
COPY pyproject.toml ./
# Install all non-dev dependencies
RUN uv sync --no-dev --no-cache
# Copy application source
COPY backend ./backend
EXPOSE 8000
CMD ["uv", "run", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]