Skip to content

Commit

Permalink
containers: use uvicorn via gunicorn rather than directly
Browse files Browse the repository at this point in the history
This container is ultimately intended for use in production, so
let's follow the advice from uvicorn docs[1] which is to use
the gunicorn server.

(I'm not aware of any specific problem with running uvicorn
directly; this is mainly a matter of following the suggested
configuration.)

[1] https://www.uvicorn.org/deployment/
  • Loading branch information
rohanpm committed Aug 7, 2020
1 parent 95ae0c7 commit 71420e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openshift/containers/exodus-gw/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ USER exodus-gw
EXPOSE 8080

# Run the application
ENTRYPOINT ["uvicorn", "exodus_gw:application", "--host", "0.0.0.0", "--port", "8080"]
ENTRYPOINT ["gunicorn", \
"-k", "uvicorn.workers.UvicornWorker", \
"--bind", "0.0.0.0:8080", \
"exodus_gw:application"]
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ starlette
aioboto3
defusedxml
uvicorn
gunicorn
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ fastapi==0.60.1 \
--hash=sha256:96f964c3d9da8183f824857ad67c16c00ff3297e7bbca6748f60bd8485ded38c \
--hash=sha256:9a4faa0e2b9c88a3772f7ce15eb4005bbdd27d1230ab4a0cd3517316175014a6 \
# via -r requirements.in
gunicorn==20.0.4 \
--hash=sha256:1904bb2b8a43658807108d59c3f3d56c2b6121a701161de0ddf9ad140073c626 \
--hash=sha256:cd4a810dd51bf497552cf3f863b575dabd73d6ad6a91075b65936b151cbf4f9c \
# via -r requirements.in
h11==0.9.0 \
--hash=sha256:33d4bca7be0fa039f4e84d50ab00531047e53d6ee8ffbc83501ea602c169cae1 \
--hash=sha256:4bc6d6a1238b7615b266ada57e0618568066f57dd6fa967d1290ec9309b2f2f1 \
Expand Down

0 comments on commit 71420e7

Please sign in to comment.