FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ && rm -rf /var/lib/apt/lists/* # Copy requirements and install Python packages COPY requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Verify streamlit is installed and accessible RUN which streamlit RUN streamlit --version # Copy application code COPY . . # Create a non-root user (optional but recommended) RUN useradd --create-home --shell /bin/bash appuser RUN chown -R appuser:appuser /app USER appuser # Expose port EXPOSE 7860 # Command to run the application CMD ["python", "-m", "streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]