添加启停脚本
Showing
2 changed files
with
27 additions
and
0 deletions
app/start.sh
0 → 100644
1 | #!/bin/bash | ||
2 | |||
3 | # 激活 conda 环境 | ||
4 | eval "$(conda shell.bash hook)" | ||
5 | conda activate spider | ||
6 | # 切换到 app 目录 | ||
7 | cd ./app || exit | ||
8 | # 后台运行 FastAPI 应用 | ||
9 | nohup python main.py & | ||
10 | # 输出进程ID到文件,以便于后续停止服务时使用 | ||
11 | echo $! > fastapi.pid | ||
12 | # 在启动之后输出pid文件中的进程ID | ||
13 | echo "怕从服务启动成功: $(cat fastapi.pid)" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
app/stop.sh
0 → 100644
-
Please register or sign in to post a comment