# Placement

- Kind: `class`
- Package: [Aspire.Hosting.Docker](/reference/api/csharp/aspire.hosting.docker.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.Docker.Resources.ServiceNodes.Swarm`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Docker/Resources/ServiceNodes/Swarm/Placement.cs)

Represents the placement configuration for a Docker service in a Swarm cluster. This class is used to define specific constraints and preferences for the placement of tasks or containers.

## Definition

```csharp
namespace Aspire.Hosting.Docker.Resources.ServiceNodes.Swarm;

public sealed class Placement
{
    // ...
}
```

## Constructors

- [Placement](/reference/api/csharp/aspire.hosting.docker/placement/constructors.md#constructor)

## Properties

- [Constraints](/reference/api/csharp/aspire.hosting.docker/placement/properties.md#constraints) : `List<string>` `get; set` -- A collection of constraints that define where tasks can be scheduled within a Swarm cluster. These constraints act as filters, ensuring that tasks are only placed on nodes that match all the specified conditions.
- [Preferences](/reference/api/csharp/aspire.hosting.docker/placement/properties.md#preferences) : `List<Dictionary<string, string>>` `get; set` -- Gets or sets the preferences for the placement strategy in the Swarm service nodes.
