Watch Aspire live streamsDocsTry Aspire

addConfig

Method
📦 Aspire.Hosting.Docker v13.6.5
interface ComposeFile {
// ... omitted for brevity
addConfig(
name: string,
file?: string,
content?: string,
external?: boolean,
configure?: callback): ComposeFile;
}

Signature

methodaddConfig
Adds a top-level config definition to the Docker Compose file.
addConfig(name: string, file?: string, content?: string, external?: boolean, configure?: (obj: Config) => Promise<void>): ComposeFile
namestringThe name of the config.
filestringoptionalThe path to the config file.
contentstringoptionalThe inline config content.
externalbooleanoptionalA value indicating whether the config is managed outside the generated Compose file.
configure(obj: Config) => Promise<void>optionalAn optional callback for further config customization.
ComposeFile

Applies to

This method applies to the following types: