Compare Docker Compose Files Online
Paste two docker-compose.yml files. See what services, volumes, and settings were added, removed, or changed — line by line.
🔒 100% private — runs entirely in your browseror try sample data
Paste two docker-compose.yml files. See what services, volumes, and settings were added, removed, or changed — line by line.
🔒 100% private — runs entirely in your browseror try sample data
Docker Compose Diff compares two docker-compose.yml files and shows you exactly which services, volumes, networks, and configuration options were added, removed, or modified. Whether you are reviewing changes between development and production compose files, upgrading service versions, or auditing infrastructure changes in a pull request, this tool gives you a clear, color-coded view of every difference.
Docker Compose files define your entire application stack — service images, port mappings, environment variables, resource limits, health checks, and inter-service dependencies. In real-world projects, you typically maintain multiple compose files for different environments (development, staging, production) or use override files to layer configurations. Changes in one environment that are not reflected in others can lead to hard-to-diagnose deployment failures. Comparing compose files visually catches these discrepancies before they reach production.
Paste your compose files from any source — your code editor, version control, or the output of docker compose config which renders the fully merged and resolved YAML. The tool handles all Compose file versions (v2, v3, and the modern format without a version field). Everything runs in your browser so your infrastructure details, including environment variables, internal hostnames, and registry URLs, stay private.
# docker-compose.yml (development)
services: app: build: . # builds from source volumes: - .:/app # hot-reload via bind mount environment: - DEBUG=true ports: - "3000:3000" # docker-compose.prod.yml (production)
services: app: image: registry.example.com/app:2.1.0 # pre-built image deploy: replicas: 3 # multiple instances resources: limits: memory: 512M environment: - NODE_ENV=production healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/health"] # Diff reveals: build vs image, debug flags,
# missing resource limits in dev, no healthcheck in devComparing dev and prod compose files ensures production has proper resource limits, health checks, pinned image tags, and no debug flags or exposed development ports.
# Before upgrade
services: db: image: postgres:15 environment: - POSTGRES_PASSWORD=secret volumes: - pgdata:/var/lib/postgresql/data # After upgrade
services: db: image: postgres:16 environment: - POSTGRES_PASSWORD=${DB_PASSWORD} # externalized volumes: - pgdata:/var/lib/postgresql/data - ./init.sql:/docker-entrypoint-initdb.d/init.sql healthcheck: test: ["CMD-SHELL", "pg_isready -U user"] interval: 10s # Diff shows: version bump, password externalized,
# init script added, healthcheck addedWhen upgrading service versions, the diff reveals not just the version change but also the additional configuration changes that should accompany it (health checks, init scripts, updated environment handling).
# Merge and resolve all compose files:
$ docker compose -f docker-compose.yml \ -f docker-compose.prod.yml \ config > resolved-prod.yaml $ docker compose -f docker-compose.yml \ -f docker-compose.staging.yml \ config > resolved-staging.yaml # Compare the resolved files to see the
# effective difference between environments
# after all overrides are appliedUse docker compose config to merge override files and resolve variables. Comparing the resolved output gives you the true effective configuration for each environment.
Docker Compose supports ${VARIABLE} syntax for environment variable interpolation. The diff tool compares the raw YAML text including these variable references. If one file uses ${DB_PASSWORD} and the other hardcodes mysecret, the diff shows this as a text change. To compare the resolved values, use docker compose config to output the interpolated YAML before comparing.
Compose files often use YAML anchors (&default) and aliases (*default) to share configuration between services. These are resolved by the YAML parser, so two files that produce identical effective configuration may look very different in the diff if they use anchors differently. Compare the docker compose config output if anchors are causing noise in the diff.
The order of services in a compose file does not affect runtime behavior — Docker Compose uses depends_on for startup ordering. However, the diff tool compares line by line, so reordering services will appear as large blocks of removed and added content. Keep services in a consistent order across files to produce cleaner diffs.
Paste both compose files into the two panels and click Compare. The tool highlights every line that was added, removed, or modified with word-level detail. You can easily spot service additions, image version changes, environment variable differences, and resource limit updates.
Yes. This is one of the most common use cases. Compare docker-compose.yml (dev) with docker-compose.prod.yml to verify that production has proper resource limits, no debug ports exposed, pinned image tags instead of :latest, and correct environment variables.
Docker Compose merges multiple files in order. To compare the effective configuration after merges, run docker compose -f file1.yml -f file2.yml config to output the resolved YAML, then compare the resolved configs from each environment.
Yes. This tool runs entirely in your browser using client-side JavaScript. Your Docker Compose files, including environment variables, registry URLs, internal hostnames, and secrets references, are never sent to any server.
Yes. The tool performs text-based comparison regardless of the Compose file version. It will highlight version number differences, syntax changes (like deploy being v3-only), and deprecated options. This is useful when migrating between Compose specification versions.
Docker Stack uses the same YAML format as Docker Compose v3, with additional deploy options for Swarm mode. Paste both files into the tool to see the differences. Stack files typically include deploy.replicas, deploy.placement, and deploy.update_config sections that are absent from local development compose files.