python
python copied to clipboard
Use gunicorn to serve the app
First fix for https://github.com/microservices/python/issues/4.
It probably makes sense to use uvicorn or similar as a next improvement.
- https://gist.github.com/erm/130ff4fa7b4d428f4e98057858795aba
- https://www.uvicorn.org/deployment/
- https://github.com/tiangolo/uvicorn-gunicorn-docker
- https://gist.github.com/Midnighter/6f848a1b2264fa453706284305673834
Another option would be to use uswgi + nginx, but that's a bit more complicated:
- https://smirnov-am.github.io/2018/08/09/flask-docker.html
- https://ianlondon.github.io/blog/deploy-flask-docker-nginx/
@wilzbach there is also https://github.com/kennethreitz/responder which is a solid project for ASGI apps. I was planning on changing Flask to Responder. Assume that works with gunicorn too
it can work with gunicorn, but you need a different worker class, fyi.