FROM python:3.11-slim WORKDIR /app # 安装 git(给 huggingface_hub 用),可按需精简 RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* # 把 loader 和 requirements 复制进镜像 COPY app_loader.py ./app_loader.py COPY requirements.txt ./requirements.txt # 安装 Python 依赖(包含 yfinance / plotly 等) RUN pip install --no-cache-dir -r requirements.txt EXPOSE 7860 CMD ["python", "app_loader.py"]