| # Use a minimal base image with Python 3.9 | |
| FROM python:3.9-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy project files | |
| COPY . . | |
| # Upgrade pip and install Python dependencies | |
| RUN pip install --upgrade pip && \ | |
| pip install -r requirements.txt | |
| # Create writable directory for Streamlit configs | |
| RUN mkdir -p /app/.streamlit | |
| # Set environment variables | |
| ENV STREAMLIT_HOME="/app/.streamlit" | |
| ENV STREAMLIT_BROWSER_GATHERUSAGESTATS="false" | |
| # Expose Streamlit port | |
| EXPOSE 8501 | |
| # Run the Streamlit app | |
| CMD ["streamlit", "run", "app.py", \ | |
| "--server.port=8501", \ | |
| "--server.address=0.0.0.0", \ | |
| "--server.enableXsrfProtection=false"] | |