portal/start.sh

20 lines
510 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
cd /var/www/XControl/dashboard
## 1. 添加 NodeSource 仓库
#curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
# 2. 安装 Node.js 和 npm
sudo apt install -y nodejs
# 安装生产依赖(跳过 devDependencies
npm install --omit=dev --registry=https://registry.npmmirror.com
npm install -g yarn --registry=https://registry.npmmirror.com
# 构建项目
/usr/bin/npm run build --registry=https://registry.npmmirror.com
# 启动 Next.js 生产服务器
/usr/bin/npm start