EXAM_RAG_API / Dockerfile
MinaNasser's picture
1st
1bc3f18
# ─────────────────────────────────────────────
# IntegraRAG β€” Production Dockerfile
# Services bundled: FastAPI + Celery worker
# External deps: Redis, Qdrant (cloud/managed)
# ─────────────────────────────────────────────
FROM python:3.11-slim
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
libmagic1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python deps first (layer cache)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application source
COPY . .
# ── Runtime env defaults (override via HF Secrets or docker run -e) ──
ENV PORT=7860 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Hugging Face Spaces exposes port 7860
EXPOSE 7860
# Entrypoint: start Celery worker in background, then FastAPI
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]