| name | dox-yaml |
| description | Create and configure dox.yaml files for the Docker Compose wrapper CLI. Use when the user asks to: (1) Create or set up a dox.yaml configuration file, (2) Add profiles, aliases, or hooks to their Docker Compose setup, (3) Configure environment-specific compose files like dev/prod/staging, (4) Set up automation hooks for container lifecycle events, (5) Define command shortcuts for common Docker Compose operations. The dox.yaml file is the project-local configuration for the 'dox' CLI tool that simplifies multi-file Docker Compose setups. |
dox.yaml Configuration Creator
Create and configure dox.yaml files for the Docker Compose wrapper CLI.
Quick Start
Ask the user what they need:
- Project structure - How many compose files? What naming pattern?
- Environments - dev, prod, staging, etc.?
- Automation needs - Pre/post hooks? Command aliases?
Then create dox.yaml in the project root.
Schema Reference
File Structure
version: 1
defaults:
profile: "dev"
slice: "dev"
auto_detect: true
profiles:
dev:
slices: [dev]
prod:
slices: [prod]
extends: dev
env_files:
dev: ".env.dev"
prod: ".env.prod"
aliases:
fresh: "down -v && up --build -d"
hooks:
pre_up:
- echo "Starting..."
post_up:
- echo "Ready!"
Discovery Configuration
discovery:
enabled: true
pattern: "compose.*.yaml"
base: "compose.yaml"
Auto-discovery finds:
- Base:
compose.yaml (preferred), docker-compose.yaml
- Slices:
compose.<name>.yaml (alphabetical)
Profile Inheritance
Child profiles inherit parent slices (prepended, de-duplicated):
profiles:
base:
slices: [base]
dev:
slices: [dev]
extends: base
full:
slices: [extra]
extends: dev
Aliases
Chain docker compose commands with &&:
aliases:
fresh: "down -v && up --build -d"
restart-all: "down && up -d"
full-start: "down -v && up --build -d && logs -f"
clean: "down -v --remove-orphans"
Usage: dox c fresh, dox c restart-all
Hooks
Available hooks: pre_up, post_up, pre_down, post_down
hooks:
pre_up:
- docker network prune -f
- echo "Starting services..."
post_up:
- echo "Services running at http://localhost:3000"
pre_down:
- echo "Stopping..."
post_down:
- echo "Cleanup complete"
Hooks:
- Run in shell context (
sh -c)
- Stop on first failure
- Pre hooks: failure blocks main command
- Post hooks: only run on success
File Discovery Priority
- Explicit
-f flags (highest)
dox.yaml profile configuration
- Auto-discovery
Common Patterns
Simple Project
version: 1
defaults:
profile: dev
profiles:
dev:
slices: [dev]
prod:
slices: [prod]
Corresponding files: compose.yaml, compose.dev.yaml, compose.prod.yaml
With Environment Files
version: 1
env_files:
dev: .env.dev
prod: .env.prod
staging: .env.staging
profiles:
dev:
slices: [dev]
env: dev
prod:
slices: [prod]
env: prod
Multi-Service Stacks
version: 1
profiles:
base:
slices: [base]
app:
slices: [app]
extends: base
db:
slices: [db]
extends: base
full:
slices: [monitoring]
extends: app
Files: compose.yaml, compose.base.yaml, compose.app.yaml, compose.db.yaml, compose.monitoring.yaml
Creation Workflow
- Ask about project structure and environments
- Determine needed profiles and slices
- Add optional features (aliases, hooks, env_files)
- Create
dox.yaml in project root
- Verify the file exists and is valid YAML