fix(entrypoint): +x 执行位 + SKIP_REDIS_CHECK 默认1(治 run535 NAS crash loop)
run535 部署后容器 crash loop(exit126),两个独立根因: 1. Permission denied: entrypoint.sh git mv 后 644 无执行位,rsync 推 NAS 也是 644, bind mount 覆盖镜像层 chmod +x 无效,tini exec 失败。→ entrypoint.sh git 100755。 2. Redis 连接超时:新版 entrypoint 检查 SKIP_REDIS_CHECK!=1 才查 Redis(旧版 if false 硬跳过),NAS 无 Redis 卡检查 crash。→ 默认 SKIP_REDIS_CHECK=1(复现旧版跳过)。 附:文档(nas-deploy-plan 方案①已实施 + ops/README 根治标记)。
This commit is contained in:
@@ -94,14 +94,7 @@ curl -s http://192.168.2.154:8000/api/v1/auth/login -X POST \
|
||||
|
||||
- **短期保护(已落实)**:上方步骤 1 命令加了 `--exclude='entrypoint.sh'`,NAS 现有文件
|
||||
不会被删,容器可继续启动。代价:dev 侧对 entrypoint 的改动不会自动同步(需手动处理)。
|
||||
- **根治方案(待用户确认采用哪种)**:
|
||||
|
||||
| 方案 | 做法 | 适用 |
|
||||
|------|------|------|
|
||||
| ① 纳入 git 根目录版本化 | dev 根目录恢复 `entrypoint.sh`(与 `docker/entrypoint.sh` 统一为同一份),去掉 `--exclude='entrypoint.sh'`,rsync 正常同步 | entrypoint 需随代码迭代频繁改 |
|
||||
| ② 由镜像层提供 | 确认 `entrypoint.sh` 由 Dockerfile `COPY` 进镜像;则 bind-mount 不应覆盖它(调整挂载/文件位置) | entrypoint 极少改、希望与代码解耦 |
|
||||
|
||||
> ⚠️ 两种方案互斥。当前默认走"短期保护",**待用户确认**后再切到 ① 或 ②。
|
||||
- **根治方案(✅ 2026-08-01 已实施方案①)**:dev 根目录恢复 `entrypoint.sh`(`git mv` 自 `docker/entrypoint.sh`,单一权威),promote 全量 rsync 自动推送(`RSYNC_EXCLUDE` 不排除 `entrypoint.sh`),NAS 宿主孤儿遗留被覆盖、可复现。Dockerfile `COPY entrypoint.sh /app/` + `ENV PYTHONPATH=/app:/app/vnpy_v4.4.0` 同步固化。方案②(镜像层提供)弃用——bind-mount 必然覆盖 /app,镜像层 entrypoint 无法生效,只能靠宿主(promote 推送的)那份。
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user