CFG-01 · Containers

Docker Compose generator

Add services, set images, ports, volumes, and environment variables, and get a ready-to-run compose.yaml — built live as you type.

compose.yaml


  

Generates the modern Compose spec (no top-level version: key — it's been optional/deprecated since Compose v2). Validate locally with docker compose config before relying on it.

What actually goes wrong in a hand-written compose file

Almost all Compose errors are indentation and quoting, not logic — YAML is whitespace-sensitive, and a port mapping like 8080:80 needs to be quoted the moment it looks like it could be parsed as a number or a time (some parsers misread unquoted 3000:3000). Building the file from a form sidesteps both: every value is quoted correctly and indentation is generated, not typed.

Ports, volumes, and the direction that trips people up

Both ports and volumes read host:container — the number or path on your machine comes first, the number or path inside the container comes second. 8080:80 means "my machine's port 8080 reaches the container's port 80"; get it backwards and the service is unreachable at the URL you expect, with no error at all.

Further reading: Why I Run Virtual Machines Instead of Bare Metal — where VMs, containers, and bare metal each make sense, and how to decide.
Do I need a "version" line in a Compose file?

No — the top-level version: key is optional and has been deprecated since the Compose Specification merged v2 and v3 into one schema. Modern docker compose ignores it if present and works fine without it, which is why this generator omits it.

What's the difference between a named volume and a bind mount?

A bind mount (./data:/app/data) maps a real path on your machine into the container — you can see and edit the files directly. A named volume (data:/app/data, with data declared separately) is managed by Docker itself, lives outside your project folder, and is the more portable choice for data you don't need to browse by hand.

What does restart: unless-stopped actually do?

It restarts the container automatically after a crash or a Docker daemon restart, but leaves it stopped if you stopped it manually with docker compose stop. That's usually the right default for anything long-running — always will fight you by restarting a container you deliberately stopped.