Read configuration from environment vars
Hey
Are the docintel apps able to read custom configuration variables from the docker environment variable settings?
This would spare having to adjust the configuration in the docker-compose.yml as well as the appsettings.json file.
Regards
Thanks for the suggestion. I'll see what can be done.
The underlying asp.net core framework supports configuration via environment variables out of the box. So every option from the appsettings.json can also be configured via an env variable in docker-compose.yml.
For nested options, you have to replace the curly braces with double underscores.
Example:
{
"ApplicationName" : "DocIntel",
"Email": {
"EmailEnabled": false
}
}
becomes in docker-compose:
webapp:
image: "docintelapp/webapp"
container_name: docintel-dev-webapp
ports:
- 5005:80
environment:
- APPLICATIONNAME=DocIntel
- EMAIL__EMAILENABLED=false
see also https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-7.0#evcp