fix bugs
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 创建日志目录(如果不存在)
|
||||
mkdir -p logs
|
||||
|
||||
# 激活虚拟环境(如果使用)
|
||||
# source venv/bin/activate
|
||||
|
||||
# 安装依赖
|
||||
pip install -r requirements.txt
|
||||
|
||||
# 使用gunicorn启动应用
|
||||
# 参数说明:
|
||||
# -w 4: 使用4个工作进程
|
||||
# -b 0.0.0.0:8123: 绑定到所有接口的8123端口
|
||||
# --access-logfile: 访问日志文件路径
|
||||
# --error-logfile: 错误日志文件路径
|
||||
# --daemon: 以守护进程(后台)方式运行
|
||||
# app:app: app.py中的app变量
|
||||
|
||||
gunicorn -w 4 -b 0.0.0.0:8123 --access-logfile logs/access.log --error-logfile logs/error.log --daemon app:app
|
||||
|
||||
echo "服务已启动在 http://服务器IP:8123"
|
||||
echo "查看进程状态: ps aux | grep gunicorn"
|
||||
echo "停止服务: pkill gunicorn"
|
||||
Reference in New Issue
Block a user