Initial commit: gamer project

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
lizhilun
2026-03-12 11:23:10 +08:00
co-authored by Claude Opus 4.6
commit a0d7bfdc3d
26 changed files with 5410 additions and 0 deletions
Executable
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
set -e
echo "=== 游戏陪玩订单系统 - Ubuntu 24.04 部署脚本 ==="
# 1. 安装 Node.js 20.x
echo ">>> 安装 Node.js..."
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# 2. 安装 PM2
echo ">>> 安装 PM2..."
sudo npm install -g pm2
# 3. 安装 Nginx
echo ">>> 安装 Nginx..."
sudo apt-get install -y nginx
# 4. 安装项目依赖
echo ">>> 安装项目依赖..."
cd /opt/gamer
npm install --production
# 5. 配置 Nginx
echo ">>> 配置 Nginx..."
sudo cp nginx.conf /etc/nginx/sites-available/gamer
sudo ln -sf /etc/nginx/sites-available/gamer /etc/nginx/sites-enabled/gamer
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl restart nginx
# 6. 启动应用
echo ">>> 启动应用..."
pm2 start ecosystem.config.js
pm2 save
pm2 startup systemd -u $USER --hp $HOME | tail -1 | sudo bash
echo "=== 部署完成!==="
echo "请访问 http://your_server_ip 使用系统"