> ## Documentation Index
> Fetch the complete documentation index at: https://libops-renovate-github-com-libops-sitectl-0-x.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# compose

> Run Docker Compose commands through the active sitectl context.

export const Compose = () => <Tooltip headline="Compose" tip={<>
        Docker Compose is Docker's tool for defining and running multi-container applications.{" "}
        <a href="https://docs.docker.com/compose/">https://docs.docker.com/compose/</a>.
      </>}>
    <>
      <Icon icon="docker" />
      {" "}
      Compose
    </>
  </Tooltip>;

# <Compose /> command

The `compose` command is a core `sitectl` command that runs <Compose /> commands against the active `sitectl` context.

Use it when you want the same <Compose /> operation to respect the site and environment wiring already stored in the context.

## Reference

Run docker compose commands on sitectl contexts.

This command wraps docker compose and automatically applies compose files, env files, and project directory
based on the current context. All docker compose commands and flags are supported.

Automatic behaviors:

* `compose up` automatically adds `-d `--remove-orphans\`\` if not already specified
* `compose build` automatically adds `--pull` if not already specified
* Compose file paths (-f flags) are injected from context.ComposeFile setting
* Env file paths (`--env-file` flags) are injected from context.EnvFile setting
* Working directory is set to context.ProjectDir

Examples:
sitectl compose up                    # Start containers in detached mode
sitectl compose down                  # Stop and remove containers
sitectl compose logs -f drupal        # Follow drupal container logs
sitectl compose ps                    # List running containers
sitectl compose exec -it drupal bash      # Open shell in drupal container
sitectl compose `--context` prod up     # Start containers on prod context

```bash theme={null}
sitectl compose COMMAND
```
