Docker Compose Validator

Validate docker-compose.yml files — check YAML syntax, service references, port conflicts, and best practices. 100% client-side.

727 chars
Click "Validate Compose File" to see the report
🔒 100% private: All validation happens in your browser. Your compose file never leaves your device.

About Docker Compose Validator

Docker Compose is a tool for defining and running multi-container Docker applications. A docker-compose.yml file declares services (containers), networks, and volumes in a single YAML document. Because Compose files are YAML and have a specific schema, small mistakes — indentation, missing depends_on targets, duplicate ports, invalid environment syntax — can cause cryptic errors when running docker-compose up. This tool validates your compose file in the browser: it parses the YAML, checks the schema, verifies that depends_on targets exist, detects circular dependencies, flags duplicate host ports, and lists common best-practice warnings (e.g., using :latest tag, mounting Docker socket, missing restart policy). Everything runs locally.

How It Works

  1. Paste your docker-compose.yml into the input box.
  2. See parse errors (YAML syntax) or schema errors immediately.
  3. Review the list of services, networks, and volumes extracted from the file.
  4. Fix any errors or warnings flagged by the validator.
  5. Copy the report or use "Load Sample" to try with a demo file.

✨ Key Features

  • ✓Parse docker-compose.yml (v2, v3, and Compose Spec)
  • ✓YAML syntax validation with line/column info
  • ✓Schema validation (top-level keys, service fields)
  • ✓List all services with image, ports, volumes, networks
  • ✓Check depends_on targets exist
  • ✓Detect circular dependencies in depends_on
  • ✓Detect duplicate host ports across services
  • ✓Detect services using :latest tag (warning)
  • ✓Detect Docker socket mounts (security warning)
  • ✓Detect missing restart policy (info)
  • ✓List all networks and volumes
  • ✓Copy the validation report
  • ✓100% client-side — no data sent to any server

🎯 Common Use Cases

  • →Debugging docker-compose.yml before running docker-compose up
  • →Checking depends_on references after refactoring services
  • →Verifying port mappings do not conflict
  • →Reviewing a compose file from a project you just cloned
  • →Learning Compose schema by getting instant feedback
  • →Catching typos in service names before deployment
  • →Checking a Compose file before committing to git
  • →Understanding a complex multi-service application

💡 Advanced Tips & Pro Insights

  • ▸Compose files use YAML — indentation with spaces (not tabs). A single tab causes cryptic parse errors. This validator flags them.
  • ▸The `version:` field is now deprecated in Compose Spec. Modern Docker Compose (v2+) works without it. A missing version is fine.
  • ▸depends_on only controls start ORDER, not readiness. If service B needs A to be fully ready, use healthcheck on A + `depends_on: { a: { condition: service_healthy } }`.
  • ▸Duplicate host ports across services cause "port already allocated" errors at runtime. This validator catches them.
  • ▸Mounting the Docker socket (/var/run/docker.sock) gives the container full Docker daemon access — a security risk. Flag as warning.
  • ▸Using `image: myapp:latest` is discouraged in production — pinning to a specific version (`myapp:1.2.3`) is safer.

Frequently Asked Questions

Is this Docker Compose validator free?▾
Yes, this Docker Compose validator is completely free with no signup, email, or usage limits.
Is my data safe?▾
Yes, 100% safe. All validation happens in your browser. Your compose file is never uploaded to any server.
What version of Docker Compose is supported?▾
Compose v2, v3, and the modern Compose Spec (used by Docker Compose v2.x). The version field is optional in the modern spec and this tool works with or without it.
Does it validate against a specific Docker Compose schema?▾
The validator checks the structure and common fields (services, networks, volumes, image, ports, volumes, depends_on, environment, etc.). It does not enforce every field of every schema version, but it catches the vast majority of practical errors.
What is a "circular dependency"?▾
A circular dependency occurs when service A depends_on B, and B depends_on A. Docker Compose cannot start such a configuration. The validator detects cycles and reports the services involved.
What are common best-practice warnings?▾
Using `:latest` image tags (unpinned versions), mounting the Docker socket (security risk), missing restart policies, exposing sensitive ports, and using `container_name` (which prevents scaling).
Does it check environment variable syntax?▾
Yes — both list form (`- KEY=value`) and map form (`KEY: value`) are supported and validated. It also flags values that need quoting.
Can I validate a Compose file with extends or includes?▾
This validator checks the content you paste. It does not resolve `extends:` or `include:` references to other files — those must be resolved at runtime by Docker Compose itself.