docktree.yml

Configuration reference for docktree.yml.

Docktree works with zero configuration — sensible defaults are provided. Create a docktree.yml in your repo root to customize behavior.

Full example

compose:
  files:
    - docker-compose.yml

worktrees:
  root: "../${repo}.worktrees"

setup:
  copy:
    - .env
  symlink:
    - node_modules
  run:
    - echo "worktree ready"

shared:
  services:
    postgres:
      kind: postgres
      tenancy: per_database

volumes:
  share:
    - shared_data

ports:
  bind_host: 127.0.0.1
  range: 41000-49999

state:
  directory: .docktree

transforms:
  container_name: strip
  built_image: rewrite
  docker_socket: warn

proxy:
  port: 8320
  host: 127.0.0.1
  tld: localhost

tunnel:
  provider: cloudflare
  port: 0

Reference

SectionKeyDefaultPurpose
compose.filesauto-detectedExplicit compose file list
worktrees.root../${repo}.worktreesWhere new worktrees are created (supports ${repo}, ${branch}, ${branch_slug})
setup.copy[".env"]Files copied from main repo to each worktree
setup.symlink["node_modules"]Symlinks created in worktrees pointing to main repo
setup.runShell commands run during setup
shared.servicesPlatform-tier shared services (kind: postgres/mysql/mongodb/redis/s3/generic; tenancy: per_database/full_share)
volumes.shareVolumes shared across all worktrees
ports.bind_host127.0.0.1Host interface for port bindings
ports.range41000-49999Port allocation range
state.directory.docktreeWhere Docktree stores instance state
transforms.*strip/rewrite/warnHow container names, built images, docker sockets are transformed
proxy.port8320Reverse proxy listen port
proxy.host127.0.0.1Reverse proxy listen host
proxy.tldlocalhostTop-level domain for routing (e.g. localhost, test)
tunnel.providercloudflareDefault tunnel provider (cloudflare or ngrok)
tunnel.port0Default local port to tunnel (0 dynamically detects first HTTP port)

Shared services

Shared services run once at the platform tier and serve all worktrees. Supported kinds: postgres, mysql, mongodb, redis, s3, generic.

Tenancy modes:

  • per_database — each worktree gets its own database namespace within a shared instance
  • full_share — all worktrees share the same data

See the platform command for managing the platform stack.