fix(deploy): sync install.py into container for Redis env-check hotfix
sync-install-wizard-to-container.sh now copies server/api/install.py and restarts Nexus so Docker installs pick up redis:6379 without full rebuild. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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`。
|
||||
|
||||
Reference in New Issue
Block a user