Skip to content

Commit

Permalink
feature: Adds gunicorn as a dependency and uvicorn worker to it
Browse files Browse the repository at this point in the history
  • Loading branch information
vmesel committed Oct 16, 2024
1 parent 3330c0e commit 17956f1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
6 changes: 4 additions & 2 deletions etc/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ if [ -n "${TEST}" ]; then
exit $?
fi

WORKERS=${WORKERS:-1}

if [ -n "${DEBUG}" ]; then
exec poetry run uvicorn main:app --host 0.0.0.0 --port ${PORT} --reload
exec poetry run gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:${PORT} main:app --workers ${WORKERS} --reload
else
exec poetry run uvicorn main:app --host 0.0.0.0 --port ${PORT}
exec poetry run gunicorn -k uvicorn.workers.UvicornWorker -b 0.0.0.0:${PORT} main:app --workers ${WORKERS}
fi
25 changes: 24 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ iniconfig = "2.0.0"
dialog-lib = "0.0.2.7"
langserve = "0.2.0"
sse-starlette = "2.1.0"
gunicorn = "^23.0.0"


[tool.poetry.group.dev.dependencies]
Expand Down

0 comments on commit 17956f1

Please sign in to comment.