How to convert a docker-compose.yml file to json
- Step 1Copy the docker-compose.yml content — Paste the full docker-compose file contents into the converter. Both Compose v2 (services at the top level) and the older version: '3.8' format are supported.
- Step 2Convert and explore the JSON structure — The output JSON has services, volumes, and networks as top-level keys. Each service contains image, ports, environment, volumes, and depends_on as nested fields.
- Step 3Extract the fields you need — Use JSONPath to pull specific data — for example $.services.*.ports to get all port mappings, or $.services.*.environment to audit all environment variables across all services.
- Step 4Feed into automation tooling — Pass the JSON to a script that generates Kubernetes manifests from Compose files, validates required labels are present on every service, or builds a network diagram from the depends_on graph.
Frequently asked questions
How are YAML extension fields (x- prefixed keys) handled?+
Docker Compose extension fields like x-common-config are preserved in the JSON output as regular keys. They are not resolved or merged — the raw values appear under the x- key just as written in the YAML file.
Will environment variables defined as a list (- KEY=VALUE format) parse correctly?+
Yes. Both the map format (KEY: value) and the list format (- KEY=VALUE) are parsed correctly. The list format is converted to an array of strings in the JSON output, preserving each KEY=VALUE pair as a string element.
Are database passwords and API keys in the environment block sent to JAD Apps?+
No. Conversion runs entirely in your browser using js-yaml. Database credentials, API keys, and any sensitive values in environment blocks are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.