Hot Reloading in Development #190
-
Absolutely throwing this one out to discussion, but one issue I find is that in development we have a separate serving mechanism from the project, e.g., we would run:
From inside the bases/example/api folder. Whereas ideally, in local development we should be using the Dockerised configuration from the projects folder, but this currently lacks hot reloading as we need to run |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Probably a lot slower than the built-in hot reload feature of hypercorn, but how about something like |
Beta Was this translation helpful? Give feedback.
-
Another option could be to have a "local dev" Dockerfile (naming it something like (This thing is about Python development in general, and not specific to Polylith) |
Beta Was this translation helpful? Give feedback.
Another option could be to have a "local dev" Dockerfile (naming it something like
Dockerfile.dev
) that mounts a volume at your local host machine instead of the production Dockerfile that copies a built wheel. I think you can do that, and have it run with a reload option. Then you can write code, and the running app in docker would reload. My recommendation would still be to run the app on your local machine directly, for a better developer experience.(This thing is about Python development in general, and not specific to Polylith)