Docker Compose File Validator & Spec Linter
Validate docker-compose.yml files against the official Compose Spec. Detect syntax errors, host port overlaps, undeclared named volumes, broken networks, and container security vulnerabilities completely client-side.
Plaintext Secret in Environment: 'POSTGRES_PASSWORD_FILE'service: db
Service 'db' contains hardcoded credentials in environment variable 'POSTGRES_PASSWORD_FILE'.
Host Port Allocation & Collision Inspector
Inspect all container port mappings. If multiple services publish the same host port on identical or wildcard (0.0.0.0) interfaces, Docker Compose will fail to bind.
| Service | Host Binding | Container Port | Protocol | Status |
|---|---|---|---|---|
| gateway | 0.0.0.0:80 | 80 | tcp | Available |
| gateway | 0.0.0.0:443 | 443 | tcp | Available |
Storage & Volume Mounts Explorer
Named volumes must be declared in top-level volumes:. Bind mounts should reference valid host paths with appropriate read-write modes.
Service Container Topology & Health
Overview of all configured services, container base images, healthcheck configurations, and dependencies.
gateway(web_gateway)
image: nginx:1.27-alpine
api
image: node:20-alpine
db
image: postgres:16-alpine
cache
image: redis:7.2-alpine
Official Compose Spec Quick Reference
Essential syntax rules for modern Compose Specification (Docker Compose v2+).
1. Top-Level Keys
- • services: (Required) Container map
- • volumes: Named storage drives
- • networks: Custom bridge/overlay nets
- • secrets: Runtime sensitive keys
- • configs: App config injection files
- • version: Deprecated in Spec 2020+
2. Port Mapping Syntax
- • "80:80" (host:container)
- • "127.0.0.1:8080:80" (bind localhost)
- • "8080:80/udp" (custom protocol)
- • "3000-3002:3000-3002" (port ranges)
- • Always quote port mappings to prevent YAML sexagesimal parse bugs!
3. Volume Mount Syntax
- • my_data:/var/lib/data (Named volume)
- • ./app:/usr/src/app:ro (Relative bind mount)
- • /var/log:/log:rw (Absolute host path)
- • Named volumes MUST be declared under top-level
volumes:
4. Service Dependencies
- • depends_on: [db, cache]
- • condition: service_healthy (Wait for healthcheck)
- • condition: service_started (Standard)
- • Circular loops (A→B→A) prevent container initialization!
Zero-Knowledge Local Execution
All data processing, parsing, and compilation execute strictly inside your local browser memory. Zero external server uploads.
Instant Client-Side Engine
Instant real-time reactive computation delivers immediate feedback on every keystroke with zero network latency.
Production Standards & Compliance
Strictly validates syntax, edge cases, and formatting rules for dependable production output.
Docker Compose File Validator & Spec Linter — Reference Guide
Validate docker-compose.yml files against the official Compose Spec. Detect syntax errors, host port overlaps, undeclared named volumes, broken networks, and container security vulnerabilities client-side.
Key Parameters & Controls
| Parameter | Type / Unit | Description | Default |
|---|---|---|---|
| services | map[string]Service | Top-level mapping defining containerized service specifications, images, and runtime flags. | Required |
| ports | array[string] | Published host-to-container port mappings. Should be string-quoted (e.g., '8080:80') to avoid YAML base-60 sexagesimal parsing errors. | Optional |
| volumes | array[string] | map | Mounts host folders (bind mounts) or persistent managed volumes (named volumes) into containers. | Optional |
| depends_on | map | array[string] | Controls service startup order and conditions (e.g. condition: service_healthy). | Optional |
Pro Tips & Best Practices
In Compose Spec (Docker v2+), the top-level 'version' attribute is obsolete. Removing it enables modern spec feature parity without schema warnings.
Always wrap port mappings in quotes (e.g. '80:80'). Unquoted ports like 22:22 can be interpreted by YAML 1.1 parsers as base-60 floating timestamps.
Use 'depends_on: { db: { condition: service_healthy } }' so application containers wait for PostgreSQL or MySQL socket readiness before booting.
Common Gotchas & Troubleshooting
⚠️Port collision or host socket already allocated error during up
Scan all service definitions for identical host ports (e.g. multiple services binding to port 8080) and map them to distinct host ports or route through an Nginx proxy.
⚠️Named volume declared in service but undeclared at top level
Any volume mounted as 'vol_name:/path' must be registered under the global root 'volumes:' key at the bottom of the file.
Frequently Asked Questions
Why is the top-level 'version' tag deprecated in Docker Compose?▼
Docker donated Compose to the open Compose Specification in 2020. Modern Docker Compose v2 treats all Compose files uniformly, rendering the old version: '3' or '2' distinction obsolete.
How does client-side Compose validation guarantee data privacy?▼
All YAML AST parsing, port overlap checking, and dependency graph checks execute in your browser's local memory. Zero bytes of your infrastructure blueprints are transmitted across the web.
What is the difference between a bind mount and a named volume?▼
Bind mounts map a direct host filesystem path (e.g. ./app:/src) into the container, whereas named volumes (e.g. pg_data:/var/lib/data) are managed within Docker's private storage area and persist across rebuilds.
How does healthcheck-based dependency order prevent race conditions?▼
Standard 'depends_on' only waits until a container process starts. 'condition: service_healthy' monitors actual socket availability and internal health probes before releasing dependent services.
Related Tools & Utilities
All Tools →Convert docker-compose.yml services, environment variables, ports, and volume mounts into Kubernetes Deployment and Service YAML.
Convert command-line docker run flags, volume mounts, port bindings, and environment variables into clean docker-compose.yml services.
Safely parse complex multi-document YAML manifests into compact or formatted JSON with strict syntax error alerts.
Convert .env environment files into JSON objects, Docker Compose YAML, or Kubernetes ConfigMap manifests with secret masking, type coercion, and variable expansion support.
Validate Kubernetes Deployment, Pod, Service, Ingress, and ConfigMap manifests against official Kubernetes OpenAPI v1.28+ schemas. Catch missing apiVersion fields, container resource limits, and privilege escalation risks.
Analyze Dockerfiles against Hadolint and Docker CIS security benchmarks. Detect root user vulnerabilities, unpinned base image digests, missing package manager cache cleanups, and multi-stage build optimization opportunities.