FROM python:3.9-slim WORKDIR /app # Create directories and set permissions RUN mkdir -p /app/.streamlit && \ chmod 777 /app/.streamlit # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application COPY . . # Set environment variables ENV STREAMLIT_SERVER_PORT=8501 ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 ENV STREAMLIT_CONFIG_DIR=/app/.streamlit EXPOSE 8501 # Run Streamlit CMD ["streamlit", "run", "src/streamlit_app.py"]