Skip to content

Commit

Permalink
Update run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
echonoshy authored Jan 3, 2025
1 parent 5e67b80 commit 7087f82
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion instances/fastapi_server/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ WORKERS=$(python config/read_config_cli app.workers)
# 启动 FastAPI 服务
echo "Starting FastAPI service on $HOST:$PORT with $WORKERS workers..."

nohup uvicorn main:app --host $HOST --port $PORT --workers $WORKERS &
# 使用uvicorn启动
# nohup uvicorn main:app --host $HOST --port $PORT --workers $WORKERS &

# gunicorn 启动更稳定
# logger已经将stdout 输出到logger file
nohup gunicorn main:app \
--bind "$HOST:$PORT" \
--workers $WORKERS \
--worker-class "uvicorn.workers.UvicornWorker" \
> /dev/null &


echo "FastAPI service is running on http://$HOST:$PORT"

0 comments on commit 7087f82

Please sign in to comment.