Compose Builder
服务清单一行一个服务
下面的单服务模板点一次追加一行,不动已有清单。
从现有文件导入可选
粘贴现成的 docker-compose.yml,会解析成七列清单覆盖当前内容;只支持单文件、常见键名,锚点与扩展字段会被忽略。
官方键库一键插入
覆盖 compose 官方服务键与顶层键,点插入会追加到下方对应的 YAML 文本框;嵌套键自动带两格缩进。
任意官方键(嵌套 YAML 块)sanitize 后合并
Compose 官方服务键有 80 多个,部分键是嵌套结构(deploy.resources、ulimits、logging.options 等),单行键值表达不了。这里按服务名写原始 YAML 块,插件会按缩进并入对应服务,键名与层级原样保留。
服务高级参数官方键
每行「服务名 | 键 | 值」,支持 build、command、entrypoint、env_file、user、working_dir、hostname、platform、shm_size、init、tty、stdin_open、read_only、stop_grace_period、dns、cap_add、cap_drop、security_opt、extra_hosts、labels、profiles、ulimits、logging、healthcheck、deploy。
顶层扩展secrets / configs
选项
docker-compose.yml—
校验
How to Use
📖 What it does
Writing compose files is mostly repetition: indent every service, quote the paths, declare volumes, and one missing line breaks the startup. This tool compresses the service list to one line each, seven fixed columns, and fills in the indentation and declarations for you.
It never calls Docker and never checks port conflicts. It only translates the list into structurally correct YAML and flags floating image tags, placeholder passwords and database ports published to the host.
Editing one line refreshes the file in about 4 ms behind a 120 ms debounce, so continuous typing never reformats the whole document repeatedly.
Lines are collected in an array and joined once, while named volumes and networks are de-duplicated through objects; a three to eight service file is 40 to 120 lines.
The workspace exposes 11 controls, from 检索键名 to 生成中文注释, and every one of them only affects the local rendering: nothing is sent back to a server.
Ranges and defaults: 插入到 (服务级 / 顶层), pull_policy (不写 / always / missing / never / build), version 字段(v2 已弃用) (不写 version(Compose v2 推荐) / 3.8(仅旧版 Compose 兼容)). Values outside the slider range are rejected rather than silently clamped.
The 检索键名 control takes free text and feeds it straight into the preview without sending it anywhere.
The 插入到 control is a dropdown with the options 服务级 / 顶层; the active option is what the export uses, so check it after every reload.
The 服务名 control takes free text and feeds it straight into the preview without sending it anywhere.
The 项目名 name control takes free text and feeds it straight into the preview without sending it anywhere.
The pull_policy control is a dropdown with the options 不写 / always / missing / never / build; the active option is what the export uses, so check it after every reload.
✨ Features
- List-style input: name, image, ports, environment, volumes, dependencies and restart policy in seven fixed columns.
- Automatic sections: services, volumes and networks are emitted only when needed, and named volumes are declared only if used.
- Quoting and indentation: bind mounts with slashes and env values with colons are quoted so YAML parsing never trips.
- Risk hints: floating image tags, change-me passwords and database ports published to the host are called out separately.
- Health checks: services with published ports get a wget probe, with a note to swap in curl if the image lacks it.
- Three presets: LNMP, Node with Redis and WordPress with MySQL, one click each.
🚀 How to use
- Write one service per line as name | image | ports | env | volumes | depends_on | restart, using - for an empty column.
- Separate multiple ports or variables with commas, for example 8080:80,443:443 or A=1,B=2.
- Set the network name (Compose v2 needs no version field), and toggle named volumes, health checks and comments.
- Read the checklist on the right and fix the image tags, placeholder passwords and database ports it names.
- Copy the file or download docker-compose.yml and run docker compose config before starting anything.
⚠️ Before you rely on it
- YAML only: nothing is started and no ports are checked, so docker compose config is your safety net.
- Do not drop named volumes: data survives docker compose down unless you pass -v.
- Close database ports: publishing 5432 or 3306 to the host opens it to the outside.
- Pin image tags: :latest or no tag silently changes version on the next rebuild.
- Depends_on is not readiness: it orders startup only; use health checks and retries for real readiness.
- Keep secrets out of the repo: replace placeholder passwords with .env values before committing.
- Interface language follows the site, not a switch inside the plugin.
- Everything stays local; reloading restores the default three-service sample.
Questions people ask: Q: Can I run docker compose up right away? A: The structure is ready, but change the image tags, passwords and mount paths for your project, and run docker compose config first. Q: Why does depends_on not guarantee availability? A: It only orders startup. A running container is not a listening port, so pair it with health checks and retries upstream. Q: A named volume is used but not declared? A: Enable the named volume switch; the tool only declares volumes that actually appear in your list. Q: Will this compose file run on an old docker-compose? A: Compose v2 no longer needs a version field, so it is omitted by default. Choose 3.8 only for legacy docker-compose 1.x/2.x hosts, then regenerate. Q: Why did the dollar sign in my environment value disappear? A: Compose expands $ references; write $$ when you need a literal dollar. The generator writes exactly what you typed and does not escape it for you. Q: Does it get messy with many services? A: Each service is indented two levels with one blank line between blocks. Past ten services, split by function into override files.
Typical use: Spinning up a local LNMP or Node plus Redis stack without hand-indenting YAML. Turning a pile of docker run commands into one committable compose file. A pre-deploy self-check on image tags, placeholder passwords and exposed database ports.
What you can enter: The service list is required, one service per line with fixed column order and - for empty cells. The network name and three toggles are optional; version is omitted by default.
What you get back: The full docker-compose.yml with services, volumes, networks and optional comments. A checklist with service and line counts plus tag, password and port warnings.
Limits to keep in mind: Translates the list into YAML only; it runs no docker command, pulls no image and checks no ports. No build section, profiles, swarm deploy blocks or secrets references. Health checks assume wget and must be swapped when the image lacks it.