start bash

This commit is contained in:
2026-04-09 09:43:21 +00:00
parent 5212cab8b6
commit 8409655e66
7 changed files with 245 additions and 7 deletions

View File

@@ -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 的环境中快速运行,直接使用: