Spaces:
Sleeping
Sleeping
File size: 915 Bytes
caec00d a08bf06 caec00d ff4937e | 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 | FROM python:3.12-slim-bullseye
# Meta-data
LABEL maintainer="Shuyib" \
description="RAG API pipeline that allows loading of documents, indexing and question" \
version="0.0" \
security_contact="check my github profile"
# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Set working directory to be /app
WORKDIR /app
# Copy requirement files first for better layer caching
COPY . /app
# Install Python dependencies chain commands to reduce layers
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# keep the port consistent with Uvicorn/Gunicorn binding
EXPOSE 7860
# Run Uvicorn with a production-ready worker
CMD ["gunicorn", "-k", "uvicorn.workers.UvicornWorker", "app:app", "-b", "0.0.0.0:7860", "--log-level", "info", "--timeout", "500"]
|