tiangolo / meinheld-gunicorn-flask-docker

Docker image with Meinheld and Gunicorn for Flask applications in Python.
MIT License
486 stars 60 forks source link

gunicorn website advice to use nginx as http proxy. what would be the best practice to include that? #23

Closed urimiller closed 4 years ago

urimiller commented 4 years ago

Hi tiangolo, this is not so much of an issue - but a question. I am not sure where to post it. I had issues working with your uwsgi-nginx - I am using flask restplus and probably had issues with my callable not being 'app' as I have been using a class instance for that..

anyway - I tried this gunicorn-flask and it worked like a charm when I specify: APP_MODULE="main:app" environment variable on docker run. I have no idea why it did not work for me on uwsgi. I bumped my head against the wall...

Anyway - I have noticed this Docker does not have nginx included - do you suggest to use that a seperate docker or somehow embed this into this gunicorn docker?

tiangolo commented 4 years ago

Hey @urimiller , Meinheld uses greenlet to work asynchronously, so you shouldn't need a frontend proxy as much as you would if you were using a synchronous worker, like a default Gunicorn worker.

Nevertheless, you can still add one, I would suggest Traefik, but mainly to handle automatic HTTPS for you.

You can check more about it and some recipes at https://dockerswarm.rocks/

github-actions[bot] commented 4 years ago

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.