FROM python:3.9-slim WORKDIR /app # Set matplotlib config directory to a writable location ENV MPLCONFIGDIR=/tmp/matplotlib COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt && \ mkdir -p /tmp/matplotlib && \ chmod -R 777 /tmp/matplotlib COPY . . EXPOSE 7860 CMD ["python", "app.py"]