fix: compose variables are now interpolated from .env file (fixes #144)

This commit is contained in:
Pasha Sviderski
2025-10-15 17:45:53 +10:00
parent dc569175ef
commit 40862df038
2 changed files with 192 additions and 1 deletions
+4 -1
View File
@@ -16,7 +16,10 @@ func LoadProject(ctx context.Context, paths []string, opts ...composecli.Project
composecli.WithName(FakeProjectName),
// First apply os.Environment, always wins.
composecli.WithOsEnv,
// Read dot env file to populate project environment.
// Set the local .env file to be loaded by WithDotEnv. COMPOSE_DISABLE_ENV_FILE can disable it.
composecli.WithEnvFiles(),
// Read environment variables from .env files set by WithEnvFiles (.env by default) to make available
// for interpolation.
composecli.WithDotEnv,
// Get compose file path set by COMPOSE_FILE.
composecli.WithConfigFileEnv,