4 ms·
how does one simply shove it in a container is my current headache. wsgi, asgi nginx gunicorn is a maze
by Already__Taken 3y ago
how does one simply shove it in a container is my current headache. wsgi, asgi nginx gunicorn is a maze
- seanhunter 3y agoQuart is pretty much "async flask". So you would do it exactly the same as you do for a flask app. ie a recipe like this should work just fine https://www.digitalocean.com/community/tutorials/how-to-build-and-deploy-a-flask-application-using-docker-on-ubuntu-20-04 https://www.digitalocean.com/community/tutorials/how-to-buil... That said I've not done it myself (yet). It's literally something I'm doing this week. Edit to add: Here's a template that looks promising actually https://github.com/cellerich/docker-quart https://github.com/cellerich/docker-quart
- trolan 3y agoI had a project which was making API calls that could take 90 seconds to generate a response from external services. My flask API was obviously blocked and when I started letting other users on I fixed the bottleneck by updating (I think) 3-5 lines of code and adding an asyncio loop. From my limited use it does seem like a drop in replacement for 'async flask'
- not_jules 3y agotwisted is pretty handy for WSGI apps. You don't need to use twisted's other features (async/event framework) to just setup a reactor and serve flask, so just add twisted to your requirements.txt and then make the entry point `python3 my_server_bootstrap.py` for the server. If you want features in front of it from nginx/haproxy I would use those as a second layer with a docker compose file or something.
- westurner 3y agoASGI > Implementations > Servers: https://asgi.readthedocs.io/en/latest/implementations.html#servers https://asgi.readthedocs.io/en/latest/implementations.html#s... ; Daphne, Uvicorn, Hypercorn, Granian, NGINX Unit asgiref: https://github.com/django/asgiref/blob/main/asgiref/sync.py https://github.com/django/asgiref/blob/main/asgiref/sync.py AsyncToSync, SyncToAsync a2wsgi: https://github.com/abersheeran/a2wsgi https://github.com/abersheeran/a2wsgi
- CameronNemo 3y agoI use uvicorn and it works well. You probably will want an ingress layer in front of that, which is where nginx, haproxy, or envoy would come in.