docker-compose.yml Validator

Compose files are easy to write incorrectly without noticing — until docker compose up fails with a cryptic error. This validator parses your compose YAML, checks against the schema, flags missing required fields, and warns about common pitfalls (legacy version: key, services referencing networks they didn't declare, image tags pinning to :latest).

How to use the docker-compose.yml Validator

Paste your compose file. The validator parses YAML, checks the schema, and runs ~15 sanity checks. Issues are categorized as errors (will likely fail at docker compose up), warnings (best-practice violations), and info (suggestions).

About docker-compose.yml Validator

Compose is Docker's tool for defining and running multi-container applications. A docker-compose.yml file describes the services (containers), networks, volumes, and secrets that make up an application stack. Compose Spec v3.x (rolled into Compose V2) is the current standard; the old top-level version: "3.8" key is no longer needed and emits a warning in recent versions.

Common pitfalls this validator catches:

  • Service name typos in depends_on — referencing a service that doesn't exist in the same file.
  • Network typos — service uses a network name not declared in top-level networks:.
  • Volume typos — named volume used but not declared in top-level volumes:.
  • Image :latest — flagged for reproducibility.
  • Plaintext secrets in environment: — should use env_file: with a gitignored file, or Docker secrets.
  • Missing restart: policy — production services should usually set restart: unless-stopped or similar.
  • Port collision — two services binding the same host port.
  • Legacy version: key — flagged for removal.
  • Build context + image both set — ambiguous; pick one.

Common use cases

  • Pre-commit check — before pushing a compose change.
  • Debugging "compose up" failures — often the error is in YAML structure, not Docker itself.
  • Onboarding new developers — give immediate feedback on their first edit.
  • Migration from v2 to current spec — flag legacy patterns.

Frequently asked questions

Does this match Compose v3 spec exactly?

Covers the common fields and pitfalls. For full schema validation use docker compose config locally.

Are profiles / extends supported?

Profiles yes (we don't enforce them, just don't error on them). Extends is parsed but cross-file resolution isn't (can't fetch the referenced file in browser).

Does it validate against a specific compose version?

Implicitly current Compose Spec (no top-level version: key needed).