ComposeFile

Handle
📦 Aspire.Hosting.Docker v17.0.0
interface ComposeFile {
configs: Dict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ComposeNodes.Config>;
extensions: Dict<string,any>;
name: string;
networks: Dict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ComposeNodes.Network>;
secrets: Dict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ComposeNodes.Secret>;
services: Dict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ComposeNodes.Service>;
version: string;
volumes: Dict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ServiceNodes.Volume>;
addConfig(name: string, file?: string, content?: string, external?: boolean, configure?: (obj: Config) => Promise<void>): ComposeFile;
addNetwork(name: string, driver?: string, external?: boolean, configure?: (obj: Network) => Promise<void>): ComposeFile;
addSecret(name: string, file?: string, external?: boolean, configure?: (obj: Secret) => Promise<void>): ComposeFile;
addService(name: string, image?: string, configure?: (obj: Service) => Promise<void>): ComposeFile;
addVolume(name: string, driver?: string, external?: boolean, configure?: (obj: Volume) => Promise<void>): ComposeFile;
}

Properties

propertyconfigsDict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ComposeNodes.Config>get · set
Represents a collection of configuration objects within a Docker Compose file. Each key in the dictionary corresponds to a configuration name, and the value is an instance of the `Config` class that contains the associated configuration details.
propertyextensionsDict<string,any>get · set
Represents a collection of user-defined extension fields that can be added to the Compose file. These extensions are represented as a dictionary where the key is a string identifier for the extension, and the value is an object that holds the custom data relevant to the extension. This allows flexibility for including additional metadata or configuration outside the scope of standard Compose file specifications.
propertynamestringget · set
Represents the name of the Docker Compose file or project.
propertynetworksDict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ComposeNodes.Network>get · set
Represents the collection of networks defined in a Docker Compose file.
propertysecretsDict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ComposeNodes.Secret>get · set
Represents the secrets section in a Docker Compose file. Contains a collection of secret definitions used within the Compose file.
propertyservicesDict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ComposeNodes.Service>get · set
Represents a collection of services defined in a Docker Compose file. Each service is identified by a unique name and contains configuration details as defined by the `Service` class.
propertyversionstringget · set
Represents the version of the Docker Compose file format being used. This property specifies the format of the Compose file and determines the supported features and behaviors.
propertyvolumesDict<string,Aspire.Hosting.Docker/Aspire.Hosting.Docker.Resources.ServiceNodes.Volume>get · set
Represents a collection of volume definitions within a Docker Compose file.

Methods

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
Adds a top-level network definition to the Docker Compose file.
addNetwork(name: string, driver?: string, external?: boolean, configure?: (obj: Network) => Promise<void>): ComposeFile
namestringThe name of the network.
driverstringoptionalThe network driver to use.
externalbooleanoptionalA value indicating whether the network is managed outside the generated Compose file.
configure(obj: Network) => Promise<void>optionalAn optional callback for further network customization.
ComposeFile
methodaddSecret
Adds a top-level secret definition to the Docker Compose file.
addSecret(name: string, file?: string, external?: boolean, configure?: (obj: Secret) => Promise<void>): ComposeFile
namestringThe name of the secret.
filestringoptionalThe path to the secret file.
externalbooleanoptionalA value indicating whether the secret is managed outside the generated Compose file.
configure(obj: Secret) => Promise<void>optionalAn optional callback for further secret customization.
ComposeFile
Adds a service definition to the Docker Compose file.
addService(name: string, image?: string, configure?: (obj: Service) => Promise<void>): ComposeFile
namestringThe name of the service.
imagestringoptionalThe container image to use for the service.
configure(obj: Service) => Promise<void>optionalAn optional callback for further service customization.
ComposeFile
methodaddVolume
Adds a top-level volume definition to the Docker Compose file.
addVolume(name: string, driver?: string, external?: boolean, configure?: (obj: Volume) => Promise<void>): ComposeFile
namestringThe name of the volume.
driverstringoptionalThe volume driver to use.
externalbooleanoptionalA value indicating whether the volume is managed outside the generated Compose file.
configure(obj: Volume) => Promise<void>optionalAn optional callback for further volume customization.
ComposeFile