Skip to content
ZeroServer.tools

Docker Run to Compose

Convert a docker run command to docker-compose.yml

services:
  webserver:
    image: nginx:latest
    container_name: webserver
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /data:/app/data
    environment:
      - NODE_ENV=production
      - PORT=3000

How docker run to docker-compose conversion works

Paste a docker run command and get a ready-to-use docker-compose.yml file. The converter parses all common flags: -p (ports), -v (volumes), -e (environment variables), --name (container_name), --network, and --restart. The -d flag is intentionally omitted — compose always runs detached. The service name defaults to the image name. Use this to migrate one-liner scripts to a reproducible Compose workflow.

Private & free — this tool runs entirely in your browser.

Recommended: IndieKit Ship your Next.js startup in days.affiliate

Related Developer Utilities tools