# ComposeFile Properties

- Package: [Aspire.Hosting.Docker](/reference/api/csharp/aspire.hosting.docker.md)
- Type: [ComposeFile](/reference/api/csharp/aspire.hosting.docker/composefile.md)
- Kind: `Properties`
- Members: `8`

Represents a Docker Compose file with properties and configurations for services, networks, volumes, secrets, configs, and custom extensions.

## Configs

- Name: `Configs`
- Modifiers: `get; set`
- Returns: `Dictionary<string, Config>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeFile.cs)

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](/reference/api/csharp/aspire.hosting.docker/config.md) class that contains the associated configuration details.

```csharp
public Dictionary<string, Config> Configs { get; set; }
```

## Extensions

- Name: `Extensions`
- Modifiers: `get; set`
- Returns: `Dictionary<string, object>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeFile.cs)

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.

```csharp
public Dictionary<string, object> Extensions { get; set; }
```

## Name

- Name: `Name`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeFile.cs)

Represents the name of the Docker Compose file or project.

```csharp
public string? Name { get; set; }
```

## Remarks

The name property is used to identify the Compose application or project when orchestrating Docker containers.

## Networks

- Name: `Networks`
- Modifiers: `get; set`
- Returns: `Dictionary<string, Network>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeFile.cs)

Represents the collection of networks defined in a Docker Compose file.

```csharp
public Dictionary<string, Network> Networks { get; set; }
```

## Remarks

Each key in the dictionary represents the name of the network, and the value is an instance of the [Network](/reference/api/csharp/aspire.hosting.docker/network.md) class, which encapsulates the details and configurations of the corresponding network.

## Secrets

- Name: `Secrets`
- Modifiers: `get; set`
- Returns: `Dictionary<string, Secret>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeFile.cs)

Represents the secrets section in a Docker Compose file. Contains a collection of secret definitions used within the Compose file.

```csharp
public Dictionary<string, Secret> Secrets { get; set; }
```

## Remarks

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](/reference/api/csharp/aspire.hosting.docker/secret.md) class, which holds the details about the secret such as file location, external status, and additional metadata like labels.

## Services

- Name: `Services`
- Modifiers: `get; set`
- Returns: `Dictionary<string, Service>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeFile.cs)

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](/reference/api/csharp/aspire.hosting.docker/service.md) class.

```csharp
public Dictionary<string, Service> Services { get; set; }
```

## Remarks

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

- Name: `Version`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeFile.cs)

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.

```csharp
public string? Version { get; set; }
```

## Volumes

- Name: `Volumes`
- Modifiers: `get; set`
- Returns: `Dictionary<string, Volume>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ComposeFile.cs)

Represents a collection of volume definitions within a Docker Compose file.

```csharp
public Dictionary<string, Volume> Volumes { get; set; }
```

## Remarks

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](/reference/api/csharp/aspire.hosting.docker/volume.md) class. Volumes can be used to share data between containers or between a container and the host system.
