-
Notifications
You must be signed in to change notification settings - Fork 238
Reload app settings on .env file change for local deployment #223
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
base: main
Are you sure you want to change the base?
Conversation
10d49aa to
f1134f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing this pr, and you said "While doing that then it is also possible to enable reloading of the application based on changes to the .env file, which is quite useful for development" but it doesn't seem to happen. I tried changing the ADMIN_PASSWORD on .env with the app running and then login as the admin with the new password.
It says the new admin tables are being created, says the app reloaded but the password doesn't actually change
f1134f6 to
fd11216
Compare
…and in the dockerfile
|
@LucasQR thanks so much for checking, perhaps you forgot to add BTW because the commits were squashed from the other PR I had to force pushed, apologies but you will need to force pull. Hope not too much trouble. let me know if you still see it not reloading on .env changes. Thanks again. |
|
Hi @LucasQR can you have another look? Check my comment above, maybe that was the issue |
At the moment there is a mixture of getting settings from environment variables and from an .env file. This is confusing and can lead to cumbersome bugs. This PR addresses the problem only for the local deployment (prod and staging will come later) where it makes it clear that settings will only be taken from the .env file (via environment variables) and removes the setting of environment variables to the runtime via the docker compose definition.
While doing that then it is also possible to enable reloading of the application based on changes to the .env file, which is quite useful for development. At the moment the app only reload when py files change.
It also removed the command in the docker compose definition and simplifies the responsibility of running the command by giving it solely to the Dockerfile (at the moment it seems to be and be promoted via the comments to change the command in either dockerfile or docker compose which is confusing for a user).