Files
Nexus/deploy/README-1panel.md
T
Nexus Deploy f37ebf8621 feat(docker): remove bundled MySQL from production Compose stack
Production installs now run only the Nexus container; MySQL and Redis are self-hosted on the machine or 1Panel, with install wizard defaults pointing at host.docker.internal.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 03:27:57 +08:00

4.0 KiB
Raw Blame History

1Panel + Docker 一键部署

重装服务器(推荐:1Panel + Docker + Nexus 一条链)

curl -fsSL "http://66.154.115.8:3000/admin/Nexus/raw/branch/main/deploy/install-1panel-docker.sh" | bash

脚本会:未装 1Panel 时提示跑官方安装 → 检测 Docker Compose → 拉代码并启动 Nexus 容器栈。

4 核 16G

curl -fsSL "http://66.154.115.8:3000/admin/Nexus/raw/branch/main/deploy/install-1panel-docker.sh" | bash -s -- --profile 4c16g

已装 1Panel,只装 Nexus

curl -fsSL "http://66.154.115.8:3000/admin/Nexus/raw/branch/main/deploy/install-1panel-docker.sh" | bash -s -- --skip-1panel

仅 Nexus Docker1Panel 已就绪)

curl -fsSL "http://66.154.115.8:3000/admin/Nexus/raw/branch/main/deploy/quick-install.sh" | bash

安装完成后浏览器打开 https://api.synaglobal.vip/app/install.html 完成向导。

MySQL / Redis(自行安装,脚本不附带)

Docker 栈仅含 Nexus 容器。MySQL 与 Redis 请在宿主机或 1Panel 应用商店单独安装。

服务 宿主机监听 安装向导步骤 3 填写
MySQL 127.0.0.1:3306 主机 host.docker.internal,端口 3306
Redis 127.0.0.1:6379 主机 host.docker.internal,端口 6379

安装向导步骤 2必须先连通 Redis 才能进入步骤 3。步骤 3 请填写自建库的用户名与密码(脚本不再生成 MYSQL_PASSWORD)。

卸载旧 Compose 内置容器:

bash /opt/nexus/deploy/uninstall-mysql-compose.sh
bash /opt/nexus/deploy/uninstall-mysql-compose.sh --purge-volume
bash /opt/nexus/deploy/uninstall-redis-compose.sh
bash /opt/nexus/deploy/uninstall-redis-compose.sh --purge-volume

1Panel 反代(必须在面板 UI 操作)

禁止 Agent/脚本直接 mkdirtee/opt/1panel/apps/openresty/ — 会破坏 bind mount。

  1. 1Panel → 应用商店 → 安装 OpenResty
  2. 网站 → 创建站点 → 反向代理 http://127.0.0.1:8600
  3. 自定义配置参考:deploy/1panel/openresty-nexus.conf.example

已 clone 到 /opt/nexus

cd /opt/nexus && git pull
bash deploy/install-nexus-fresh.sh --skip-clone

NX 运维菜单

nx          # 主菜单
nx god      # 上帝菜单(重启 Python / 升级 / 日志)

装好后会注册:nexus-install · nx · nexus-fresh

脚本说明

文件 用途
install-1panel-docker.sh 重装服务器一键链(1Panel + Docker + Nexus
quick-install.sh 仅 Nexus Docker1Panel 已装好)
install-nexus-fresh.sh 全新空库安装(被上面两个脚本调用)
nexus-1panel.sh 迁机 / 升级底层
nx 交互菜单

资源档位

--profile 1c4g · 2c8g(默认)· 4c16g

密钥(每台新服务器唯一)

全新安装(install-nexus-fresh.sh / --fresh)会调用 scripts/generate_nexus_secrets.py 自动生成:

  • NEXUS_SECRET_KEY / NEXUS_API_KEY / NEXUS_ENCRYPTION_KEY(与安装向导算法一致)

MySQL 密码由你在自建库时设定,安装向导步骤 3 填写。

写入 docker/.env.prod,备份到 /root/.nexus-install-secrets-*.envchmod 600)。

场景 命令
新机(推荐) curl | bashinstall-nexus-fresh.sh
迁机保留旧密钥 nexus-1panel.sh install --from-env /path/to/old/.env
显式复用 secrets 文件 nexus-1panel.sh install --reuse-secrets勿用于新机

Gitea 令牌:公共仓库 curl | bash / git clone 不需要配置。仅私人仓库时可选 /root/.nexus-deploy.envnexus-1panel.sh init-token

安装向导 /app/install.html

生产镜像 Dockerfile.prod 已内置 install.html + vendorAlpine/Tailwind)。升级后若 404

cd /opt/nexus && git pull
bash deploy/nexus-1panel.sh upgrade   # 会 --build 重建镜像
# 或仅同步到当前容器(旧镜像兜底):
bash deploy/sync-install-wizard-to-container.sh