README
docker-composer
Generate Docker Compose descriptor from a JSON document.
About the package
The reason behind this package is support the Docker Compose descriptor generation from Javascript. You are able to use all Docker Compose keyword to describe your containers and services.
Docker Compose Reference is HERE.
Changes of the Latest Release
Version 4.1.0 (23.02.2022)
- Extending networking schema with name property. (Thanks @shoxxdj)
- Dependency updates
You can find all Release Notes HERE.
Usage
const composer = require('docker-composer')
.
var generatedYML = composer.generate( inputJSON )
Full Example
Input
{
"version" : "3",
"services" :
{
"nginx" : {
"ports" : [
"80"
],
"image" : "nginx:latest"
},
"http" : {
"ports" : [
"443"
],
"image" : "apache:latest"
}
}
}
Result
---
version: "3"
services:
nginx:
ports:
- "80"
image: "nginx:latest"
http:
ports:
- "443"
image: "nginx:latest"
License
Copyright (c) 2015 Tibor Udvari. Released under the MIT license. See LICENSE for details.