tiangolo / uvicorn-gunicorn-docker

Docker image with Uvicorn managed by Gunicorn for high-performance web applications in Python with performance auto-tuning.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploying docker image with Nginx

kleysonr opened this issue · comments

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 ?

Never expose any container directly to the internet. You should use a Reverse Proxy. That's also what they mean in the docs,

EDIT:
I meant that you shouldn't expose any containers which aren't made for being exposed.

if you have docker you can use another container to act as a proxy.
in kubernetes with an ingress, in docker compose with another another docker (apache or nginx) will do this job if you want to expose it outside.

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.