# Deploy Properties

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

Represents the deployment configuration for a Docker service. This class is used to define various aspects such as replication, mode, resource constraints, updates, and restart policies.

## Labels

- Name: `Labels`
- Modifiers: `nullable` `get; set`
- Returns: [LabelSpecs?](/reference/api/csharp/aspire.hosting.docker/labelspecs.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/Swarm/Deploy.cs)

Represents the label configurations for a deployable service in Docker.

```csharp
public LabelSpecs? Labels { get; set; }
```

## Remarks

This property is used to define additional metadata, typically in the form of key-value pairs, that can be attached to services for organizational or descriptive purposes.

## Mode

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

Gets or sets the deployment mode for the service. Specifies how tasks are scheduled on nodes. Common values include "replicated" for distributing tasks across nodes or "global" for running a task on every node in the cluster.

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

## Placement

- Name: `Placement`
- Modifiers: `nullable` `get; set`
- Returns: [Placement?](/reference/api/csharp/aspire.hosting.docker/placement.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/Swarm/Deploy.cs)

Specifies the placement constraints and preferences for service deployment.

```csharp
public Placement? Placement { get; set; }
```

## Remarks

The `Placement` property defines the rules for how the service should be placed on nodes within a Docker Swarm. This includes constraints that must be satisfied and preferences to guide the scheduler.

## Replicas

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

Represents the number of task replicas for a service node deployment. The replicas define the desired count of independently running instances of the service within the deployment.

```csharp
public int? Replicas { get; set; }
```

## Resources

- Name: `Resources`
- Modifiers: `nullable` `get; set`
- Returns: [Resources?](/reference/api/csharp/aspire.hosting.docker/resources.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/Swarm/Deploy.cs)

Represents the resource configurations for a deployable service within Docker.

```csharp
public Resources? Resources { get; set; }
```

## Remarks

The `Resources` class is used to define resources such as CPU and memory that are allocated to or reserved for a service. It includes configurations for both resource limits and reservations.

## RestartPolicy

- Name: `RestartPolicy`
- Modifiers: `nullable` `get; set`
- Returns: [RestartPolicy?](/reference/api/csharp/aspire.hosting.docker/restartpolicy.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/Swarm/Deploy.cs)

Specifies the restart policy for a Docker service.

```csharp
public RestartPolicy? RestartPolicy { get; set; }
```

## Remarks

The RestartPolicy defines conditions under which the service containers will be restarted, as well as parameters like delay between restarts, maximum restart attempts, and a time window for evaluating restart conditions.

## UpdateConfig

- Name: `UpdateConfig`
- Modifiers: `nullable` `get; set`
- Returns: [UpdateConfig?](/reference/api/csharp/aspire.hosting.docker/updateconfig.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/Swarm/Deploy.cs)

Represents the update configuration used during service deployments.

```csharp
public UpdateConfig? UpdateConfig { get; set; }
```

## Remarks

The `UpdateConfig` property defines the parameters associated with updating services. It allows configuration of update behavior such as parallelism, delays, failure actions, and monitoring.
