Files
zjpb.net/QUICK_DEPLOY.md

95 lines
1.3 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.
# 1Panel部署快速指南
## 简化部署步骤
### 1. 准备工作(本地)
1. 压缩项目:
```bash
# 排除不需要的文件
zip -r zjpb.zip . -x "*.pyc" "*__pycache__*" "*.git*" ".env" "venv/*" "test_*.py"
```
### 2. 服务器操作
#### 2.1 上传并解压
```bash
cd /www/wwwroot
mkdir zjpb
cd zjpb
# 上传zjpb.zip到此目录
unzip zjpb.zip
```
#### 2.2 一键部署脚本
```bash
# 赋予执行权限
chmod +x deploy.sh
# 执行部署
./deploy.sh
```
### 3. 配置数据库
在1Panel中创建数据库
- 名称ai_nav
- 用户ai_nav_user
- 密码:(记录下来)
### 4. 配置环境变量
编辑 `.env` 文件:
```bash
nano .env
```
填写数据库信息和密钥。
### 5. 初始化
```bash
source venv/bin/activate
python init_db.py
```
### 6. 启动服务
**方法1: 使用管理脚本**
```bash
chmod +x manage.sh
./manage.sh start
```
**方法2: 使用1Panel**
在1Panel中创建反向代理网站指向 `http://127.0.0.1:5000`
### 7. 访问
- 前台http://your-domain.com
- 后台http://your-domain.com/admin/login
- 默认账号admin / admin123
---
## 快速命令参考
```bash
# 启动应用
./manage.sh start
# 停止应用
./manage.sh stop
# 重启应用
./manage.sh restart
# 查看状态
./manage.sh status
# 查看日志
./manage.sh logs
```
详细部署文档请查看:`DEPLOYMENT.md`