Skip to content

Docker Compose Validator

Validate Docker Compose YAML for syntax errors, unknown keys, port and volume syntax, missing or circular depends_on, and undeclared networks.

Docker Compose Validator

3 services0 errors0 warnings3 passed
docker-compose.yml59 lines
Validation results3 issues found
Passed (3)
Service "web" is well-structured

Uses a build context

Service "db" is well-structured

Uses image: postgres:16-alpine

Service "redis" is well-structured

Uses image: redis:7-alpine

Validation checks performed

Structure

Validates top-level keys, version format, services presence, and ensures each service is a valid mapping.

Services

Checks image/build presence, valid service keys, port mappings, volume mounts, environment variables, and restart policies.

References

Verifies depends_on targets exist, network references match defined networks, and named volumes are declared.

Common mistakes

Detects typos (port vs ports, volume vs volumes), circular dependencies, and unusual configuration values.

Updated . Provided as is. Check the output before you rely on it in production.

How to use Docker Compose Validator

  1. 1

    Paste your docker-compose.yml

    Copy your entire docker-compose file and paste it into the validator. It checks YAML syntax and Docker Compose structure immediately.

  2. 2

    Review validation results

    See a list of errors, warnings, and info messages with line numbers. Common issues: undefined services, missing dependencies, invalid syntax.

  3. 3

    Fix common errors

    Errors like 'depends_on references unknown service' point at a service name that is not defined. 'Unusual version format' means the version string is not one Compose recognises.

  4. 4

    Check service dependencies and networks

    The validator flags depends_on entries pointing at services that do not exist, self-references and dependency cycles, and any network a service joins that is missing from the top-level networks block.

  5. 5

    Verify volume mounts

    It checks volume mount syntax and that every named volume is declared under the top-level volumes key. It runs in the browser and cannot see your filesystem, so it never checks whether a host path exists.

Questions and answers

What is Docker Compose Validator?
Docker Compose describes a multi-container app in one YAML file: services, images or builds, ports, volumes, networks and dependencies. This validator flags YAML errors, unknown service keys, invalid port and volume syntax, missing or circular depends_on targets, and undeclared networks and volumes.
What kinds of errors does it detect?
It detects YAML syntax errors, invalid service keys, circular depends_on references, missing referenced services, invalid port mapping and volume mount syntax, undeclared networks and volumes, and other common Docker Compose mistakes.

Use it as an API

Docker Compose Validator is also callable as a free HTTP JSON API at https://aidevhub.io/api/docker-compose-validator/ — GET with query parameters or POST with a JSON body, no authentication, CORS enabled, fair use (abusive traffic is throttled at the edge; there is no per-request quota header). Responses return { ok, tool, result, meta }.

curl -s -X POST https://aidevhub.io/api/docker-compose-validator/ \
  -H "Content-Type: application/json" \
  -d '{"content":"services:\n  web:\n    image: nginx:1.27\n    ports:\n      - 8080:80"}'

Machine-readable contract: /api/tool/docker-compose-validator.json All API endpoints: /agents/ LLM site index: /llms.txt

For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Dedicated API endpoint

Deterministic outputs, machine-safe contracts, and production-ready examples.

Dedicated API

https://aidevhub.io/api/docker-compose-validator/

OpenAPI: https://aidevhub.io/api/openapi.yaml

GET /api/docker-compose-validator/ GET docker-compose-validator
POST /api/docker-compose-validator/ POST docker-compose-validator