-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Docker Compatibility #45
Conversation
This should address #44 for the most part. |
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.
Thanks for the PR, I added some comment, feel free to comments.
Also could you rebase from master
please.
And I guess you were talking about closing #44
viper.SetTypeByDefaultValue(true) // Allows []string to be parsed from Env Vars | ||
|
||
viper.SetDefault("host", "tinshop.example.com") | ||
viper.SetDefault("protocol", "http") |
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.
Is function ComputeDefaultValues
, http
is assumed if no protocol, so default value is not needed
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 think this is a matter of preference, so I will make my case but accept your decision.
viper
needs a default set (could be nil
) in order to assign ENV vars to configuration keys.
For the sake of standardization, I believe this could stay here, and the ComputeDefaultValues
should test for invalid values and force them to be the default, instead of being the default section “setter”. This way, all the default values are in one place. What are your thoughts?
@@ -32,6 +32,52 @@ To proper use this software, here is the checklist: | |||
|
|||
Now simply run it and add a shop inside tinfoil with the address setup in `config` (or `http://localIp:3000` if not specified). | |||
|
|||
# 🐋 Docker |
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 would add this section after Dev or build from source
and maybe add a sentence with link and this end of 🎮 Use
to talk about how to use it with docker.
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 moved the section below Dev or build from source
but I don't understand the 🎮 Use
part.
Please see #46 - PR against |
This set of commits enables TinShop to run on Docker without the need of a
config.yaml
file mapping.I am running as a container and without a configuration file. All settings were transported successfully.
According to Viper docs, ENV vars naturally supersede a config file. I mapped all the missing configs on
viper
.