Skip to content
Docs Try Aspire

ComposeFile Properties

Class Properties 8 members
Represents a Docker Compose file with properties and configurations for services, networks, volumes, secrets, configs, and custom extensions.
Configs Section titled Configs Dictionary<string, Config>
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.
public Dictionary<string, Config> Configs { get; set; }
Extensions Section titled Extensions Dictionary<string, object>
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.
public Dictionary<string, object> Extensions { get; set; }
Name Section titled Name nullable string?
Represents the name of the Docker Compose file or project.
public string? Name { get; set; }
The name property is used to identify the Compose application or project when orchestrating Docker containers.
Networks Section titled Networks Dictionary<string, Network>
Represents the collection of networks defined in a Docker Compose file.
public Dictionary<string, Network> Networks { get; set; }
Each key in the dictionary represents the name of the network, and the value is an instance of the Network class, which encapsulates the details and configurations of the corresponding network.
Secrets Section titled Secrets Dictionary<string, Secret>
Represents the secrets section in a Docker Compose file. Contains a collection of secret definitions used within the Compose file.
public Dictionary<string, Secret> Secrets { get; set; }
Each secret is represented as a key-value pair, where the key is the name of the secret, and the value is an instance of the Secret class, which holds the details about the secret such as file location, external status, and additional metadata like labels.
Services Section titled Services Dictionary<string, Service>
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.
public Dictionary<string, Service> Services { get; set; }
Services are a critical part of the Docker Compose ecosystem and are used to define individual application components. These components can include images, commands, environment variables, ports, volumes, dependencies, and more.
Version Section titled Version nullable string?
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.
public string? Version { get; set; }
Volumes Section titled Volumes Dictionary<string, Volume>
Represents a collection of volume definitions within a Docker Compose file.
public Dictionary<string, Volume> Volumes { get; set; }
The volumes are defined using a dictionary structure where the key represents the name of the volume, and the value is an instance of the Volume class. Volumes can be used to share data between containers or between a container and the host system.