# Use a lightweight Python base image FROM python:3.9-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ bash \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Create a non-root user RUN useradd -m -u 1000 user # Copy application files COPY app.py . COPY chunks.txt . # Switch to non-root user USER user # Set environment variable for Gemini API key (to be provided via Hugging Face Secrets) ENV GEMINI_API_KEY=AIzaSyDteeiTCZIt9J-NntBUrdWLG3WuXGhules # Run the Streamlit app CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]