feat(docker): remove bundled Redis; use external host install

Compose stack is MySQL+Nexus only; wizard Redis check is non-blocking
and defaults to host.docker.internal for self-managed Redis.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nexus Deploy
2026-06-06 02:48:00 +08:00
parent c81fe3183f
commit 6276ea08b7
15 changed files with 156 additions and 55 deletions
+8 -9
View File
@@ -116,14 +116,13 @@ def _docker_wizard_defaults() -> dict[str, str] | None:
"""Prefill install step 3 when running inside docker-compose.prod.yml."""
if os.environ.get("NEXUS_DOCKER_WRITE_ENV") != "1" and not os.environ.get("REDIS_HOST"):
return None
rh, rp, _ = _resolve_redis_probe()
return {
"db_host": os.environ.get("MYSQL_HOST", "mysql"),
"db_port": os.environ.get("MYSQL_PORT", "3306"),
"db_name": "nexus",
"db_user": "nexus",
"redis_host": rh,
"redis_port": str(rp),
"redis_host": "host.docker.internal",
"redis_port": "6379",
"redis_db": "0",
}
@@ -443,9 +442,9 @@ async def env_check():
"pass": False,
})
# Redis — Docker Compose: redis:6379 (not published on host 127.0.0.1)
# Redis — 用户自行安装(1Panel/宿主机),不阻塞安装向导
redis_ok = False
redis_msg = "安装"
redis_msg = "检测"
rh, rp, rpass = _resolve_redis_probe()
redis_label = f"{rh}:{rp}"
try:
@@ -461,14 +460,14 @@ async def env_check():
redis_ok = True
redis_msg = f"✓ 已连接 {redis_label}"
except Exception as e:
redis_msg = f"连接失败: {e}"
redis_msg = f"连接 {redis_label}(可继续,步骤3配置或稍后安装 Redis)— {e}"
except ImportError:
redis_msg = "redis 库未安装"
redis_msg = "redis 库未安装(可继续)"
checks.append({
"name": "Redis",
"required": "已连接",
"required": "自行安装(步骤3配置)",
"current": redis_msg,
"pass": redis_ok,
"pass": True,
})
# MySQL database — user configures in step 3