> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# stack

> cpln stack — Manage docker-compose files and deploy multi-service stacks to Control Plane.

manage docker-compose files

Refer to the [Compose Deploy guide](/guides/compose-deploy) for additional details.

```none theme={null}
cpln stack [SUBCOMMAND]
```

```text theme={null}
Commands:
  cpln stack deploy    deploy from a docker-compose file  [aliases: up]
  cpln stack manifest  Generate a CPLN apply file from a docker-compose file
  cpln stack rm        Delete objects from a docker-compose file  [aliases: down]

Options:
  --help  Show help  [boolean]
```

***

#### stack deploy

deploy from a docker-compose file

Refer to the [compose deploy guide](/guides/compose-deploy) for more details.

**Usage**

```none theme={null}
cpln stack deploy [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --directory, --dir  Path to parent folder of docker-compose file
    --compose-file      Name of the docker-compose file if alternative naming was used
    --build             Build images  [boolean] [default: true]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Assuming there is a docker compose project in the current directory

  <CodeGroup>
    ```bash Command theme={null}
    cpln stack deploy
    ```

    ```text Output theme={null}
    Created /org/demo-cpln-organization/secret/demo-secret
    Created /org/demo-cpln-organization/gvc/demo-cpln-gvc/identity/demo-identity
    Created /org/demo-cpln-organization/gvc/demo-cpln-gvc/volumeset/demo-volume
    Created /org/demo-cpln-organization/gvc/demo-cpln-gvc/workload/demo-workload
    Created /org/demo-cpln-organization/policy/demo-policy
    ```
  </CodeGroup>
</Accordion>

***

#### stack manifest

Generate a CPLN spec file from a compose project. Outputs result to stdout. Note: this command will build and push images to CPLN

**Usage**

```none theme={null}
cpln stack manifest [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --directory, --dir  Path to parent folder of docker-compose file
    --compose-file      Name of the docker-compose file if alternative naming was used
    --build             Build images  [boolean] [default: false]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Assuming there is a docker compose project in the current directory.

  <CodeGroup>
    ```bash Command theme={null}
    cpln stack manifest
    ```

    ```yaml Output theme={null}
    kind: secret
    name: demo-secret
    description: demo-secret
    type: opaque
    data:
      encoding: plain
      payload: demo secret
    ---
    kind: identity
    name: demo-identity
    description: Identity to allow demo-workload to reveal secret
    ---
    kind: volumeset
    name: demo-volume
    description: demo-volume
    spec:
      fileSystemType: ext4
      initialCapacity: 10
      performanceClass: general-purpose-ssd
    ---
    kind: workload
    name: demo-workload
    description: demo-workload
    spec:
      type: standard
      containers:
        - name: demo-workload-container
          cpu: 250m
          memory: 53Mi
          ports:
            - number: 3000
          image: demo-image:1.0
          volumes:
            - path: /secrets/secret.txt
              uri: 'cpln://secret/demo-secret'
              recoveryPolicy: retain
      defaultOptions:
        capacityAI: false
      identityLink: /org/demo-cpln-organization/gvc/demo-cpln-gvc/identity/demo-identity
      firewallConfig:
        external:
          inboundAllowCIDR:
            - 0.0.0.0/0
          outboundAllowCIDR:
            - 0.0.0.0/0
    ---
    kind: policy
    name: demo-policy
    description: Policy for workloads to reveal demo-secret
    bindings:
      - permissions:
          - reveal
        principalLinks:
          - /org/demo-cpln-organization/gvc/demo-cpln-gvc/identity/demo-identity
    targetKind: secret
    targetLinks:
      - /org/demo-cpln-organization/secret/demo-secret
    ```
  </CodeGroup>
</Accordion>

***

#### stack rm

Delete all resources generated from a docker compose project.

**Usage**

```none theme={null}
cpln stack rm [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --directory, --dir  Path to parent folder of docker-compose file
    --compose-file      Name of the docker-compose file if alternative naming was used

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command
    --gvc      Override the global virtual cloud. The default global virtual cloud can be set in your profile by using the `cpln profile update` command

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Assuming there is a docker compose project in the current directory

  <CodeGroup>
    ```bash Command theme={null}
    cpln stack rm
    ```

    ```text Output theme={null}
    Deleted /org/demo-cpln-organization/secret/demo-secret
    Deleted /org/demo-cpln-organization/gvc/demo-cpln-gvc/identity/demo-identity
    Deleted /org/demo-cpln-organization/gvc/demo-cpln-gvc/volumeset/demo-volume
    Deleted /org/demo-cpln-organization/gvc/demo-cpln-gvc/workload/demo-workload
    Deleted /org/demo-cpln-organization/policy/demo-policy
    ```
  </CodeGroup>
</Accordion>

***
