Closed tvories closed 2 years ago
I'm aware of that the way how environment variables are the defined is not "state of the art" compared to other projects. It's just the way how .NET handles the appsettings.json
file. That would be also my workaround proposal for the meantime:
Bind the appsettings.json
like below and configure everything there.
- volumes:
- ./config/appsettings.json:/app/appsettings.json
For the future I can maybe change this to get rid of the :
character.
@TheAxelander that's perfect! I can easily mount appsettings.json to the container. My only concern is if the app changes, then writing the entire config file may run into versioning issues if you add a new field or something. For now I think I can get this to work, though.
This is the example I have on my setup right now:
{
"Connection": {
"Provider" : "mysql",
"Database": "openbudgeteer-dev", <-- these values must be overridden by the environment variables? because this is not my env setting
"Server": "192.168.178.86",
"Port": "3306",
"User": "openbudgeteer-dev",
"Password": "openbudgeteer-dev"
},
"AppSettings": {
"Culture": "en-US"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
These values must be overridden by the environment variables? Because this is my live docker deployment and I have different information set in my env's.
Fixed on pre-release
I'm trying to create a helm chart for this project so you can run it in a kubernetes cluster. Helm won't allow for the unique way you are setting environment variables like
Connection:Provider
. Is there another way to pass these values in? I realize it's not your job to support helm, but I am very curious if you have any ideas.Here's the error I'm getting in helm if you were curious: