Validate Docker Compose Online — YAML Structure Checker

Parse Compose YAML and check services structure. Not a full Compose spec validator.

Loading…
Docker Compose validator, YAML structure
Catch missing services keys and empty service definitions before docker compose config runs in CI. The checks are structural, not the full Compose specification.

Developer notes

Rejects YAML multi-document streams (---). Does not validate ports, networks or deploy keys against the spec. Unknown top-level keys are info only. Pair with beautify-yaml for formatting. Issues and severity counts appear in the results panel (structural Compose checks only).

When teams pick this route

Validate a compose snippet from Stack Overflow before paste into repo. Ensure services: exists in a generated file. Quick check on a minimal dev stack (web + db). Catch duplicate-document mistakes in merged YAML.

Worked examples

Valid dev stack with web + redis

Compose YAML

version: "3.9" services: web: image: nginx:1.25-alpine ports: - "8080:80" depends_on: - redis networks: - frontend redis: image: redis:7-alpine volumes: - redis-data:/data networks: - frontend networks: frontend: driver: bridge volumes: redis-data:

Validation result

Valid: every service is present and has an image. The result appears in the results panel.

Missing services key

Compose YAML

version: "3.9" networks: frontend: driver: bridge volumes: data:

Validation result

Error: the required top-level "services" key is missing. The result appears in the results panel.

Navigate related DevOps tools

Format YAML with beautify YAML. Container images: lint Dockerfile.

Compose validator FAQ

Structural checks

Full Compose spec validation?

No, we check YAML shape and common mistakes, not every key against the spec.

Compose v2 without version?

Root must still be a mapping with services for this tool to pass.

Multi-document YAML?

It is rejected, because a Compose file should be a single document.

Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.