agent-ready Compose guide

Validate a Docker Compose File from Claude Code

Use compose.new to check a Docker Compose file produced by Claude Code before deploying it with Defang.

Claude Code can generate a Compose file quickly, but validation should happen before deployment. The file should be syntactically valid, readable, and aligned with the app’s real runtime needs.

Validation request for Claude Code

Validate this Docker Compose file for deployment. Check service names, build contexts, public ports, health checks, environment variables, secrets, volumes, and managed-service annotations. Keep the file simple enough for a human to review.

What compose.new helps with

compose.new is a browser-based tool with a Compose file generator, syntax validator, and service graph visualizer. It gives you a focused place to inspect the Compose file, validate the structure, and reason about the app topology. This is useful when Claude Code generated the first version and you want a second pass before running deployment commands.

What to check manually

Confirm that exposed ports match the app framework. Confirm that databases and caches are not exposed publicly. Confirm that secret values are absent (use defang config set to store them securely). Confirm that health checks call real endpoints. Confirm that service dependencies match the app’s startup behavior.

Deploy after validation

After validation, set up a stack and deploy with Defang:

defang login
defang stack new    # interactive: select provider, region, name the stack
defang compose up

Use Defang Agent Skills

Install Defang Agent Skills in Claude Code so the same agent-assisted workflow can move from Compose validation into Defang estimates, deployment, and debugging.

Practical workflow

If Claude Code generated a Compose file, do not deploy blindly. Validate the file in compose.new, make the deployment intent visible, then use Defang for the cloud deployment.