Files
etf/Dockerfile
aszerW ecd8d6539f feat(datasource): 股票info字段放到API响应最外层
- yfinance_source.py: stock_info 存储在 df.attrs['info'] 中
- flask_server.py: dataframe_to_json 从 df.attrs 提取 info 放到最外层
- flask_server.py: 缓存切片函数保留 info 字段
- Dockerfile: 启用 Flask 服务作为默认 CMD(端口80)

响应结构示例:
{
  "data": [{"date": "2024-01-01", "code": "AAPL", ...}],
  "info": {"sector": "Technology", "industry": "...", ...}
}
2026-05-13 00:26:19 +08:00

27 lines
668 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM index-base:latest
# 设置工作目录
WORKDIR /app
# 复制依赖文件
COPY requirements.txt .
RUN uv pip install --system -r requirements.txt
# 仅复制除 data 目录外的应用代码, data 在 dockerignore 中已经被排除
COPY . .
# 创建日志目录
RUN mkdir -p /app/logs
# 设置时区为上海
ENV TZ=Asia/Shanghai
# 暴露端口如需Web服务
EXPOSE 80
# 启动Flask数据API服务默认端口80
CMD ["python", "datasource/flask_server.py", "--host", "0.0.0.0"]
# 运行定时任务调度器如需使用Flask服务取消上面注释并注释掉下面
# CMD ["python", "scripts/daily_scheduler.py", "--time", "09:00"]