Comments (8)
I have tried
uvicorn.run(self.app, host=host, port=port, debug=True)
and this
uvicorn.run(self.app, host=host, port=port, reload=True)
not working in VSCode
from uvicorn-gunicorn-fastapi-docker.
just create a env GUNICORN_CMD_ARGS="--reload"
http://docs.gunicorn.org/en/stable/settings.html#reload
or you can insert into gunicorn-conf.py
reload = True
from uvicorn-gunicorn-fastapi-docker.
Aarrgghhh! Yes that works great - read somewhere that didn’t work and didn’t test it. Shame on me.
Thanks!
Thanks also for the env tip - works great with Docker compose.
from uvicorn-gunicorn-fastapi-docker.
Great project and thanks!
Awesome! I'm glad it's working for you.
@rudmac Thanks for your help here! It's very appreciated. 👏 🌮
There's a new integrated script /start-reload.sh
specifically for this.
It runs only Uvicorn with --reload
, optimal for development.
Check the updated docs here: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#development-live-reload
from uvicorn-gunicorn-fastapi-docker.
Thanks - I'll update the writeup I made for it: https://medium.com/@williamhayes/fastapi-starlette-debug-vs-prod-5f7561db3a59 (future note for myself (ever searched for a solution to a problem and find an old post with the answer - still undecided if it is embarrassing or an example of impressive forethought))
FYI - looks like --reload and --debug are equivalent currently in uvicorn. I'll make a note of that as well.
from uvicorn-gunicorn-fastapi-docker.
Thanks! And great post!
In Uvicorn, --debug
was the "standard" up to 0.5.0
, now it will be --reload
, it's very recent.
Check: fastapi/fastapi#66
from uvicorn-gunicorn-fastapi-docker.
Can reloading be working without a gunicorn?
from uvicorn-gunicorn-fastapi-docker.
Can reloading be working without a gunicorn?
Not easily without either uvicorn
or gunicorn
. It's possible to replicate reload without it, but you still need an ASGI server to run FastAPI anyway.
from uvicorn-gunicorn-fastapi-docker.
Related Issues (20)
- Application does not start up when combining this image and a database connection in Linux CentOS. HOT 4
- Upgrade from python3.8 to python3.11 fails HOT 1
- ModuleNotFoundError: No module named 'app' HOT 2
- APScheduler logs not showing in docker HOT 1
- websocket can not use
- Deploying HuggingFace model/pipeline using uvicorn-gunicorn-fastapi-docker on Google Cloud Run HOT 2
- Is --proxy-headers applied in the uvicorn CMD in the image? HOT 1
- getting timeout 504 in 1 minute
- Support for Apple sillicon
- New docker-image may be broken HOT 1
- apt-get update not working on specific version
- container build fails with pydantic-settings HOT 1
- Uvicorn -gunicorn-fastapi-docker
- Runtime Error: Can't start new thread HOT 2
- linux/arm64/v8 not supported HOT 2
- Unexpected Redirection of `/docs` Endpoint with Custom `APP_MODULE` Setup
- Current gunicorn version does not support Python 3.11 HOT 1
- Base Dockerfile HOT 3
- pydantic_settings package not supported
- Update fastapi to support Pydantic2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uvicorn-gunicorn-fastapi-docker.