Files
chinese-family-tree-2/DEPLOY_QUICK_START.md
T
freedakgmail 3b0d8255f6 0.0.8.1
2025-11-23 19:38:51 +08:00

78 lines
1.4 KiB
Markdown
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.
# 🚀 快速部署指南
## 一键部署
```bash
./deploy.sh
```
## 配置要点
### 1. 修改服务器信息(deploy.sh
```bash
SERVER_IP="115.190.235.230" # 你的服务器IP
SSH_PORT="22" # SSH端口
APP_PORT="8006" # 应用端口
DB_PASSWORD="FamilyTree2024" # 数据库密码
```
### 2. 确保本地有.env文件
```bash
cp .env.example .env
# 编辑.env配置数据库等信息
```
### 3. 执行部署
```bash
chmod +x deploy.sh
./deploy.sh
```
## 访问地址
```
http://115.190.235.230:8006
```
## 常用命令
| 操作 | 命令 |
|------|------|
| 查看状态 | `ssh root@115.190.235.230 'pm2 status'` |
| 查看日志 | `ssh root@115.190.235.230 'pm2 logs chinese-family-tree'` |
| 重启应用 | `ssh root@115.190.235.230 'pm2 restart chinese-family-tree'` |
| 更新部署 | `./deploy.sh` |
## 故障排查
### npm下载慢
```bash
ssh root@115.190.235.230
pnpm config set registry https://registry.npmmirror.com
```
### 数据库连接失败
检查服务器上的.env文件:
```bash
ssh root@115.190.235.230 'cat /var/www/chinese-family-tree/.env'
```
### 端口被占用
```bash
ssh root@115.190.235.230 'lsof -i :8006'
```
## 防火墙配置
```bash
# Ubuntu/Debian
sudo ufw allow 8006/tcp
# CentOS
sudo firewall-cmd --permanent --add-port=8006/tcp
sudo firewall-cmd --reload
```
## 完整文档
详细说明请查看:[DEPLOY_README.md](./DEPLOY_README.md)