About Composerize
Got a docker run command that's grown into a wall of
flags? Paste it here and get the equivalent
docker-compose.yml service back. That's the whole tool.
It parses the common flags — ports, volumes, env vars, restart policies, networks — and emits clean YAML you can drop into a compose file and version alongside your code. Everything runs in the browser, which matters when your command contains a token or a path you'd rather not paste into some random website.
The usual reason to bother: ad-hoc docker run commands
don't get versioned, don't get reviewed, and die with your shell
history. Compose files live in the repo where the rest of your
infrastructure lives.
How to convert docker run to Docker Compose
Paste your docker run command above. Composerize converts supported flags into a Docker Compose service. Copy the output into docker-compose.yml and review it before starting the container.
For example, docker run --name web -p 8080:80 nginx maps the nginx image, the web container name, and port 8080 on your host to port 80 in the container. A minimal equivalent Compose file is:
services:
web:
image: nginx
container_name: web
ports:
- "8080:80"
Save the file, then use docker compose config to check it and docker compose up -d to start it. Review volumes, environment variables, and networking for your environment; not every Docker flag has an equivalent Compose setting.
Frequently Asked Questions
What is Composerize?
Composerize is a tool that converts a long docker run command into a clean, version-controlled docker-compose.yml file. It parses flags such as ports, volumes, environment variables, restart policies and networks, and emits the equivalent YAML service definition.
How do I convert docker run to Docker Compose?
Paste your docker run command into the input box and the equivalent docker-compose.yml service comes out the other side. Copy it into a compose file and run docker compose up -d.
Which docker run flags are supported?
Common flags are supported: -p/--publish, -v/--volume, -e/--env, --name, --restart, --network, --log-opt, --privileged, --user and many others. Unsupported exotic flags are preserved in the output where possible.
Is my docker command private?
Yes. The conversion runs entirely in your browser. Commands containing sensitive environment variables, tokens or paths never leave your device — no server processing.