DevOps
Docker Compose (JSON) JSON Example
A Docker Compose configuration as a JSON example — services, images, ports, environment, volumes, and depends_on. Copy-ready reference for multi-container app definitions.
Field Reference
servicesrequiredobjectMap of service name → service definition; each becomes a containerservices.<name>.imageoptionalstringImage to run (or use 'build' to build from a Dockerfile)services.<name>.portsoptionalarray<string>Port mappings as 'HOST:CONTAINER'services.<name>.depends_onoptionalarray<string>Start order — these services start before this onevolumesoptionalobjectNamed volumes for persistent data shared across runsVariants
Build from DockerfileBuild a service from local source instead of pulling an image.
Common Use Cases
- →Defining a local multi-container dev environment
- →Documenting how an app's services fit together
- →Converting compose configuration between YAML and JSON
dockerdocker composecontainersdevopscompose
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.
Frequently Asked Questions
Related JSON Examples
DevOpsKubernetes Deployment Manifest (JSON)Kubernetes Deployment manifest in JSON with replicas, containers, resources, and probes.DevOpsGitHub Actions Workflow (JSON)GitHub Actions workflow in JSON with triggers, a job, steps, and a matrix.DataApp Config FileBackend config with database connection, auth settings, feature flags, and logging.