Skip to main content

command

The compose command is a core sitectl command that runs commands against the active sitectl context. Use it when you want the same operation to respect the site and environment wiring already stored in the context. For local development contexts, sitectl compose up checks whether the default HTTP or HTTPS host port is already in use. If another process owns a needed port, sitectl writes docker-compose.override.yml with a Compose ports: !override entry for the next available development port before invoking Docker Compose. HTTP-only stacks publish target port 80. Stacks that publish target port 443, or whose Traefik command declares an HTTPS entrypoint on :443, are treated as HTTPS for local URL detection. This behavior only applies to local dev contexts, not local production workloads. See Managed applications for the application template Compose contract.

Reconcile

For local plugin-owned contexts, a plain full-stack sitectl compose up can perform a reconcile before handing off to Docker Compose. It reads the plugin’s default create definition, checks init artifacts, declared volumes, and local image metadata, then runs the plugin’s init and build commands when they are still needed. This lets a setup-only checkout start cleanly:
You can also run reconcile explicitly:
An up with a profile, selected services, or behavior-changing flags such as --wait or --build passes through unchanged so sitectl does not replace the requested operation with a plugin’s full-stack start. Normalized defaults such as -d, --remove-orphans, and sitectl’s local-daemon --no-build still qualify for automatic reconcile. Run reconcile explicitly first in specialized workflows such as:
The reconcile cache is local to the workstation and expires after 7 days. --force ignores the cache and reruns build/up. --reset-init removes plugin-declared init artifacts and init volumes, clears the cache entry, then reconciles again. The reconcile step is a synchronous CLI workflow for one local project. It borrows condition names such as Initialized and ImagesAvailable, but it is not a Kubernetes controller or background loop.

Clean

Use sitectl compose clean when you need to throw away local runtime state and return to a fresh init/build flow:
clean runs docker compose down -v, removes plugin-declared init artifacts such as generated secrets, certs, UID markers, and env files, and clears the reconcile cache entry. It is destructive and prompts for a typed confirmation unless --yes is passed. See Compose reconcile contract for the contributor-facing contract.

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 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
Run plugin Docker Compose init/build/up reconciliation. This is the same lifecycle repair path sitectl runs automatically before a plain full-stack sitectl compose up for plugin-managed local Compose projects. Starts with additional Compose flags or selected services pass through unchanged; run this command explicitly first when those starts also need lifecycle repair. Use --force to rerun build/up even when the project is cached as current. Use --reset-init to remove plugin-declared init artifacts and init volumes before reconciling.
Destroy local Compose containers, volumes, and plugin init state. This command runs docker compose down -v, removes init artifacts declared by the active plugin, and clears the local compose reconcile cache entry. It is destructive: database volumes, uploaded files stored in named volumes, generated secrets, certificates, and env files declared by the plugin can be lost.