Skip to content
DocsTry Aspire
DocsTry

ComposeFile

Handle
📦 Aspire.Hosting.Docker v13.4.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
namestring
filestringoptional
contentstringoptional
externalbooleanoptional
configure(obj: Config) => Promise<void>optional
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
namestring
driverstringoptional
externalbooleanoptional
configure(obj: Network) => Promise<void>optional
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
namestring
filestringoptional
externalbooleanoptional
configure(obj: Secret) => Promise<void>optional
ComposeFile
Adds a service definition to the Docker Compose file.
addService(name: string, image?: string, configure?: (obj: Service) => Promise<void>): ComposeFile
namestring
imagestringoptional
configure(obj: Service) => Promise<void>optional
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
namestring
driverstringoptional
externalbooleanoptional
configure(obj: Volume) => Promise<void>optional
ComposeFile