docker-compose-converter
v0.2.0
Published
Convert docker run/create commands to docker-compose.yml files.
Downloads
19
Maintainers
Readme
docker-compose Converter
Convert docker run/create commands to docker-compose.yml files.
Example
Input
docker run -d \
-v nextcloud:/var/www/html \
nextcloud
docker run -d \
-v db:/var/lib/mysql \
mariadb
Output
version: '3'
services:
nextcloud:
image: nextcloud
volumes:
- 'nextcloud:/var/www/html'
mariadb:
image: mariadb
volumes:
- 'db:/var/lib/mysql'
Usage
Install
npm install docker-compose-converter --save
Include
const dcc = require('docker-compose-converter');
const dockerRunCommands = `
docker run -d \
-v nextcloud:/var/www/html \
nextcloud
docker run -d \
-v db:/var/lib/mysql \
mariadb
`;
const dockercomposeyml = ddc(dockerRunCommands);
console.log(dockercomposeyml);