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

Updated Uvicorn to 0.14.0 to increase ws max_size to > 1mb, but doesn't work, & get "error walking file system: FileNotFoundError [Errno 2] No such file or directory: '/app/.venv/bin/python'"

turukawa opened this issue · comments

I needed to update Uvicorn to 0.14.0 since this version permits websockets to send > 1mb of data in a message. However, since 0.12.0, Uvicorn no longer includes uvloop, websockets and httptools as default, which requires uvicorn[standard].

Updated in Poetry. However, when I then restart the Docker image, I get the following error scrolling off indefinitely:

error walking file system: FileNotFoundError [Errno 2] No such file or directory: '/app/.venv/bin/python'

These articles give me some indication it has something to do with Uvicorn and reload, but I'm a little lost as to how to fix it:

If I use /start.sh instead of /start-reload.sh the problem goes away, which then reveals that the ws max_size limit is still 1mb. Which may have something to do with gunicorn.

I'd like to edit /start.sh or /start-reload.sh to see if I can fix things there, but can't figure out how to do that (although, potentially, that involves forking the repo?).

I am now thoroughly lost as the errors cascade, and - before I bury myself any deeper - thought I'd ask for help here.

My starting point is the https://github.com/tiangolo/full-stack-fastapi-postgresql deployment.

Hey! You should probably include Uvicorn and Gunicorn in your dependencies in Poetry's pyproject.toml, that would override the versions in this image, and you can update and control all the dependencies on your side.

Check the renovated guide here: https://github.com/tiangolo/uvicorn-gunicorn-docker#how-to-use

Also, have in mind that if you are in Kubernetes or similar you might want to not use this Docker base image: https://github.com/tiangolo/uvicorn-gunicorn-docker#-warning-you-probably-dont-need-this-docker-image

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