FROM python:3.9-slim # Set the working directory WORKDIR /app # 1. Install ONLY the absolute necessities RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ && rm -rf /var/lib/apt/lists/* # 2. Copy and install requirements COPY requirements.txt . RUN pip3 install --no-cache-dir -r requirements.txt # 3. Copy the rest of the code COPY . . # 4. Streamlit environment variables ENV STREAMLIT_SERVER_PORT=7860 ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 # 5. Launch CMD ["streamlit", "run", "streamlit_app.py"]