# ✅ Use Python 3.11 (ensures compatibility with pysqlite3) FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ libsqlite3-dev \ && rm -rf /var/lib/apt/lists/* # Add a non-root user RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" # Set working directory WORKDIR /app # Copy and install dependencies COPY --chown=user requirements.txt ./requirements.txt RUN pip install --no-cache-dir -r requirements.txt # 👉 Fix sqlite issue by installing pysqlite3-binary RUN pip install pysqlite3-binary==0.5.2 # Copy the entire app COPY --chown=user . /app # Expose the port (required by HF) EXPOSE 7860 # Run the Streamlit app CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]