diff --git a/deploy/sync-install-wizard-to-container.sh b/deploy/sync-install-wizard-to-container.sh index 396187de..090a95c7 100644 --- a/deploy/sync-install-wizard-to-container.sh +++ b/deploy/sync-install-wizard-to-container.sh @@ -47,6 +47,22 @@ main() { sync_file "$app/vendor/theme.css" /app/web/app/vendor/theme.css sync_file "$app/vendor/alpinejs.min.js" /app/web/app/vendor/alpinejs.min.js + local install_py="$NEXUS_ROOT/server/api/install.py" + if [[ -f "$install_py" ]]; then + info "同步 install.py(Docker Redis env-check 修复)..." + sync_file "$install_py" /app/server/api/install.py + info "重启 Nexus 容器以加载 Python 变更..." + docker restart "$CONTAINER" >/dev/null + for _ in $(seq 1 30); do + if curl -sf http://127.0.0.1:8600/health >/dev/null 2>&1; then + break + fi + sleep 2 + done + else + warn "未找到 $install_py,跳过 Python 热同步" + fi + local code code="$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8600/app/install.html 2>/dev/null || echo 000)" if [[ "$code" == "200" ]]; then diff --git a/docs/changelog/2026-06-05-install-wizard-docker-redis.md b/docs/changelog/2026-06-05-install-wizard-docker-redis.md index 65a69e9d..ddcbd8e2 100644 --- a/docs/changelog/2026-06-05-install-wizard-docker-redis.md +++ b/docs/changelog/2026-06-05-install-wizard-docker-redis.md @@ -20,8 +20,7 @@ Compose 栈中 Redis 仅在容器内网 `redis:6379`,未映射宿主机端口 ```bash cd /opt/nexus && git pull -bash deploy/sync-install-wizard-to-container.sh -docker compose -f docker/docker-compose.prod.yml --env-file docker/.env.prod restart nexus +bash deploy/sync-install-wizard-to-container.sh # 同步 install.html + install.py 并重启 ``` -或 `nexus-1panel.sh upgrade` 重建镜像。 +无需完整 rebuild;若仍失败再 `bash deploy/nexus-1panel.sh upgrade`。