Skip to content
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

Allow configuration from environment variables #50

Open
deranjer opened this issue Feb 15, 2022 · 1 comment
Open

Allow configuration from environment variables #50

deranjer opened this issue Feb 15, 2022 · 1 comment

Comments

@deranjer
Copy link
Contributor

Docker convention tends to encourage environment variables for configuration of container parameters.

I need a 404 for my static sites, so I override the entrypoint with -fallback, but I find this method is extremely rare among docker containers (and not well documented in this project).

Was wondering if you would consider looking at the namsral/flag package for allowing setting parameters from environment variables. The best part is that it appears to be a drop in replacement for the std library flag package.

Per the documentation, cmd line params would always take precedence over environment variables if there was a conflict. As long as it really is a drop-in replacement, there shouldn't be any breaking changes while aligning more closely with Docker standards.

The namsral/flag pkg does also allow loading from a .conf file, but that would require some additional code, and I don't see a need to add that feature at this time.

Let me know what you think.

@PierreZ
Copy link
Owner

PierreZ commented Feb 15, 2022

I like the idea, feel free to open a PR 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants