Files
sanguo_vnpy_v2/docker/Dockerfile.nas
T
claude_dev 6d786fbf41
CI/CD / test (push) Successful in 8s
CI/CD / nas-deploy (push) Failing after 33s
CI/CD / nas-verify (push) Has been skipped
fix(orchestrator): spawn 子进程 PYTHONPATH + entrypoint 回根治孤儿
ProcessPoolExecutor(spawn)子进程不继承主进程 sys.path(insert 是内存修改),
import sanguo_orchestrator 失败->BrokenProcessPool->API 回测静默失败,POST 秒回
task_id 但轮询永远 404。spawn 继承 env 不继承 sys.path,故:
1. Dockerfile ENV PYTHONPATH=/app:/app/vnpy_v4.4.0(镜像层,bind mount 覆盖不了)
2. entrypoint.sh 回仓库根(git mv 自 docker/):promote --exclude /docker 致旧版
   entrypoint 在 NAS 成 git 外孤儿(340行,被 bind mount 覆盖镜像层);回根后全量
   rsync 自动推可复现(对齐 docs/deployment/nas-deploy-plan.md 预设修复)+export 兜底
3. 三 Dockerfile COPY 路径同步

反馈: 策略 session(根因诊断+探针验证)
2026-08-01 21:33:20 +08:00

36 lines
810 B
Docker

# Sanguo VeighNa 应用镜像
# 基于基础镜像,只包含应用代码
FROM sanguo_vnpy:base
LABEL maintainer="sanguo"
LABEL description="Sanguo VeighNa Application Layer"
# 设置工作目录
WORKDIR /app
# 复制应用代码
COPY sanguo_trader/ ./sanguo_trader/
COPY sanguo_research/ ./sanguo_research/
COPY sanguo_data/ ./sanguo_data/
COPY sanguo_common/ ./sanguo_common/
COPY sanguo_web/ ./sanguo_web/
COPY vnpy_v4.4.0/vnpy/ ./vnpy/
COPY config/ ./config/
# 复制启动脚本
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
# 创建数据目录
RUN mkdir -p /app/data /app/logs
# 暴露端口
EXPOSE 8000 8080
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# 启动
ENTRYPOINT ["./entrypoint.sh"]