chore: handle x-caddy: path/to/Caddyfile to read Caddy config in compose from file

This commit is contained in:
Pasha Sviderski
2025-08-13 13:45:39 +10:00
parent 879c7c1876
commit ec73f9ecd8
5 changed files with 115 additions and 12 deletions
+4 -1
View File
@@ -25,8 +25,8 @@ func LoadProject(ctx context.Context, paths []string, opts ...composecli.Project
// If none was selected, get default Compose file names from current or parent folders.
composecli.WithDefaultConfigPath,
composecli.WithExtension(CaddyExtensionKey, Caddy{}),
composecli.WithExtension(PortsExtensionKey, PortsSource{}),
composecli.WithExtension(MachinesExtensionKey, MachinesSource{}),
composecli.WithExtension(PortsExtensionKey, PortsSource{}),
}
options, err := composecli.NewProjectOptions(
@@ -42,6 +42,9 @@ func LoadProject(ctx context.Context, paths []string, opts ...composecli.Project
return nil, err
}
if project, err = transformServicesCaddyExtension(project); err != nil {
return nil, err
}
if project, err = transformServicesPortsExtension(project); err != nil {
return nil, err
}