qlib-quant-platform / Dockerfile
Serena2026's picture
Fix: use correct qlib data download method
a4fba15 verified
Raw History Blame Contribute Delete
619 Bytes
# Qlib 量化平台 - Hugging Face Spaces Docker 镜像
FROM python:3.10-slim
# 设置工作目录
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
gcc \
g++ \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# 复制依赖文件
COPY requirements.txt .
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 复制应用代码
COPY . .
# 创建数据目录
RUN mkdir -p /root/.qlib/qlib_data
# 设置启动脚本权限
RUN chmod +x start.sh
# 暴露端口(Hugging Face Spaces 使用 7860)
EXPOSE 7860
# 启动命令
CMD ["bash", "start.sh"]