FROM python:3.9-slim # Prevent Python from writing pyc files ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ gcc \ libglib2.0-0 \ libgl1 \ && rm -rf /var/lib/apt/lists/* # Set work directory WORKDIR /app # Copy requirements first (better caching) COPY requirements.txt . # Upgrade pip and install dependencies RUN pip install --upgrade pip \ && pip install --no-cache-dir -r requirements.txt # Copy app code COPY . . # Streamlit port EXPOSE 8501 # Run Streamlit CMD ["streamlit", "run", "streamlit_app.py", "--server.address=0.0.0.0", "--server.port=8501"]