-
-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Option to enable live reload #1
Comments
Yep, there's a new integrated script in the image Check the new docs here: https://github.com/tiangolo/uvicorn-gunicorn-docker#development-live-reload Let me know if it works for you. |
Should we maybe also use the |
I don't think that's needed @chbndrhnns . This is only for quick development iterations, but for production that shouldn't be used at all. |
I am aware that reload on change is not for production. However, when I develop on my laptop on battery, I noticed a huge difference when using ---reload-dir compared to --reload. I usually want a reload only on changes in my app directory but with --reload, uvicorn also looks in .venv/, for example. This leads to a high CPU load which matters to me when developing on battery. This is why I prefer --reload-dir |
Get it, I think you could add it as a custom script for your use case @chbndrhnns , for example, you could add your own But I wouldn't add it as a default as other people will probably have different workflows. @Ancient123 if your question was solved, then you can close this issue 🚀 |
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
whythawk-full-stack-fastapi-postgresql#1 tiangolo/uvicorn-gunicorn-docker#1 tiangolo/uvicorn-gunicorn-docker#6 PR #1 updated the backend Docker image from https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker to https://github.com/br3ndonland/inboard (see https://inboard.bws.bio). The previous Docker image had a start-reload.sh script, which started Uvicorn with reloading. With inboard, there's no need for a separate script. The same effect can be achieved with environment variables (`PROCESS_MANAGER=uvicorn`, `WITH_RELOAD=true`).
gunicorn has the
--reload
option ( http://docs.gunicorn.org/en/19.0/settings.html#reload ) which helps with developing in the docker environment without constant rebuilds.I tested it by adding
--reload
to the startup script manually but it would probably make sense to use a environment variable flag to enable/disable this.The text was updated successfully, but these errors were encountered: