expose all env variables to the app container

This commit is contained in:
Moritz 2023-01-26 12:17:58 +01:00
parent 667264b5bb
commit da46996e6b
1 changed files with 16 additions and 0 deletions

View File

@ -445,5 +445,21 @@ func GetAppComposeConfig(recipe string, opts stack.Deploy, appEnv AppEnv) (*comp
logrus.Debugf("retrieved %s for %s", compose.Filename, recipe)
ExposeAllEnv(compose, appEnv)
return compose, nil
}
// expose all env variables to the app container
func ExposeAllEnv(compose *composetypes.Config, appEnv AppEnv) {
for _, service := range compose.Services {
if service.Name == "app" {
logrus.Debug("Add the following environment to the app service config:")
for k, v := range appEnv {
value := v
service.Environment[k] = &value
logrus.Debugf("Key: %s Value: %s", k, value)
}
}
}
}