FROM python:3.9-slim WORKDIR /app COPY . . # 设置 matplotlib 配置目录到/tmp(可写目录) ENV MPLCONFIGDIR=/tmp/matplotlib_config RUN pip install --no-cache-dir -r requirements.txt CMD ["python", "app.py"]