File size: 671 Bytes
4f9286e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # ===== HUST RAG Backend =====
FROM python:3.11-slim
WORKDIR /app
# Install dependencies first (cached layer)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project code
COPY core/ core/
COPY scripts/ scripts/
COPY evaluation/ evaluation/
# Create data directory (mount at runtime)
RUN mkdir -p data
# Expose API port
EXPOSE 8000
# Environment variables (override at runtime)
ENV GROQ_API_KEY=""
ENV SILICONFLOW_API_KEY=""
ENV API_HOST="0.0.0.0"
ENV API_PORT="8000"
# Run download_data.py first (checks if data exists, downloads if not), then start FastAPI server
CMD python scripts/download_data.py && python core/api/server.py
|