Aryan2301/YouTube_RAG_Intelligence
0
1FROM python:3.12-slim2 3# Create non-root user4RUN useradd -m -u 1000 appuser5 6WORKDIR /app7 8# Install build tools (needed for chroma-hnswlib) and dependencies9COPY requirements.txt .10 11RUN apt-get update \12 && apt-get install -y --no-install-recommends build-essential \13 && pip install --no-cache-dir --upgrade pip \14 && pip install --no-cache-dir -r requirements.txt \15 && apt-get purge -y --auto-remove build-essential \16 && rm -rf /var/lib/apt/lists/*17 18# Copy application files19COPY --chown=appuser:appuser . .20 21# Run as non-root user22USER appuser23 24# Hugging Face Spaces public port25EXPOSE 786026 27ENV PYTHONUNBUFFERED=128 29# Start FastAPI internally and Streamlit publicly30CMD ["sh", "-c", "uvicorn api:app --host 0.0.0.0 --port 8000 & exec streamlit run app.py --server.port=7860 --server.address=0.0.0.0 --server.fileWatcherType=none --browser.gatherUsageStats=false"]