-
The Gunicorn documentation says to have an Nginx in front of the Gunicorn. How to change the uvicorn-gunicorn-docker to add also the Nginx to handle the requests ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Never expose any container directly to the internet. You should use a Reverse Proxy. That's also what they mean in the docs, EDIT: |
Beta Was this translation helpful? Give feedback.
-
if you have docker you can use another container to act as a proxy. But you should not stack layer inside a docker container since it's suppose to be elastic. with an nginx inside you are no more elastic. |
Beta Was this translation helpful? Give feedback.
-
Now that Uvicorn supports managing workers with Because of that, I deprecated this Docker image: https://github.com/tiangolo/uvicorn-gunicorn-docker#-warning-you-probably-dont-need-this-docker-image You can probably read more about all that process to have a termination proxy in the FastAPI docs for Deployments with Docker: https://fastapi.tiangolo.com/deployment/docker/ |
Beta Was this translation helpful? Give feedback.
Now that Uvicorn supports managing workers with
--workers
, including restarting dead ones, there's no need for Gunicorn. That also means that it's much simpler to build a Docker image from scratch now, I updated the docs to explain it.Because of that, I deprecated this Docker image: https://github.com/tiangolo/uvicorn-gunicorn-docker#-warning-you-probably-dont-need-this-docker-image
You can probably read more about all that process to have a termination proxy in the FastAPI docs for Deployments with Docker: https://fastapi.tiangolo.com/deployment/docker/