Docker Compose Validator
Free docker-compose.yml validator. Paste a Compose file and get a basic structural sanity check, entirely in your browser.
The one check that catches the most common typo
A service with neither `image` nor `build` is syntactically valid YAML but semantically useless — Compose has no way to know what container to actually run for it, and the error you'd get from `docker compose up` about it is often less direct than "this service is missing an image." That single check — every service needs one or the other — catches a surprisingly common mistake: a service block that got half-written, or one where an `image:` line was accidentally deleted during an edit, sitting unnoticed in a file until someone actually tries to bring the stack up.
Why port mapping format gets checked specifically
The `ports` section has more valid shapes than it might seem — a bare port number, `host:container`, `host:container/protocol`, or a full `ip:host:container` binding — and a value that looks plausible but doesn't match any of these forms (a stray letter, a missing colon, a typo'd protocol) will often fail silently or bind to the wrong thing rather than raising an obvious error. Checking this structurally, before the compose file is ever actually run, catches exactly the class of mistake that's easy to type and easy to miss in a quick read-through, but that only becomes visible once a service unexpectedly can't be reached on the port you expected.
What "structural" means here — and its limit
This check operates purely on the shape of the document: does the right top-level key exist, does each service have the minimum it needs to run, are the fields that look like a specific format actually in that format. It has no knowledge of the full Docker Compose specification — networks, secrets, configs, profiles, healthchecks, and dozens of other keys are simply not inspected — and it never validates that a referenced image actually exists or that a build context is a valid path. Treat a clean result as "this file has the basic shape Compose needs," not as a guarantee the stack will actually start correctly.