Docker Run to Compose Converter v1.0

Transform your Docker run commands into Docker Compose YAML format with ease.

Example Commands

Click any example to try it:

Web Server Examples

Simple Nginx Server

docker run -d --name my-nginx -p 80:80 nginx Basic web server with port mapping

Nginx with Custom Config

docker run -d -p 8080:80 -v /root/nginx.conf:/etc/nginx/nginx.conf -v /root/html:/usr/share/nginx/html --name my-nginx --restart=always nginx:latest Production-ready Nginx with custom configuration and content

Dashboard Examples

Dashy Dashboard

docker run -d -p 4000:8080 -v /root/my-local-conf.yml:/app/user-data/conf.yml --name my-dashboard --restart=always lissy93/dashy:latest Personal dashboard with custom configuration and automatic restart

Grafana Dashboard

docker run -d -p 3000:3000 -v grafana-storage:/var/lib/grafana --name my-grafana --restart=always grafana/grafana-oss Monitoring dashboard with persistent storage

Database Examples

MySQL Database

docker run -d --name my-mysql -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=myapp -v mysql-data:/var/lib/mysql -p 3306:3306 mysql:8 MySQL server with environment variables and persistent storage

PostgreSQL Database

docker run -d --name my-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_DB=myapp -v postgres-data:/var/lib/postgresql/data -p 5432:5432 postgres:13 PostgreSQL server with custom database and volume

Advanced Examples

Redis with Custom Config

docker run -d --name my-redis -v redis.conf:/usr/local/etc/redis/redis.conf -p 6379:6379 --restart unless-stopped redis redis-server /usr/local/etc/redis/redis.conf Redis with custom configuration and automatic restart

Node.js App with Resource Limits

docker run -d --name my-node-app -p 3000:3000 -e NODE_ENV=production --memory="512m" --cpus="0.5" --restart always node:16 npm start Node.js application with memory and CPU limits