start bash
This commit is contained in:
31
README.md
31
README.md
@@ -201,6 +201,37 @@ npm run dev
|
||||
- 后端:http://localhost:8000
|
||||
- 健康检查:http://localhost:8000/api/health
|
||||
|
||||
## 后台启动脚本
|
||||
|
||||
如果你不想用 Docker,可以直接用项目根目录下的脚本把前后端挂到后台:
|
||||
|
||||
```bash
|
||||
chmod +x start.sh stop.sh status.sh
|
||||
./start.sh
|
||||
```
|
||||
|
||||
脚本会做这些事:
|
||||
|
||||
- 后台启动 FastAPI,默认端口 `8000`
|
||||
- 后台启动 Vite,默认端口 `8451`
|
||||
- 把 PID 写到 `.run/`
|
||||
- 把日志写到 `logs/`
|
||||
|
||||
常用命令:
|
||||
|
||||
```bash
|
||||
./status.sh
|
||||
./stop.sh
|
||||
tail -f logs/backend.log
|
||||
tail -f logs/frontend.log
|
||||
```
|
||||
|
||||
如果你要改端口,可以在启动前传环境变量,前端代理也会自动跟着后端端口变化:
|
||||
|
||||
```bash
|
||||
BACKEND_PORT=9000 FRONTEND_PORT=8451 ./start.sh
|
||||
```
|
||||
|
||||
## Docker 启动
|
||||
|
||||
如果你希望在 Ubuntu 24.04 或其他装有 Docker 的环境中快速运行,直接使用:
|
||||
|
||||
Reference in New Issue
Block a user