Generate Docker Compose descriptor from a JSON document.
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.
- Update dependencies
- Support aux_addresses keyword in network/ipam config object
- Support attachable keyword in network config object
You can find all Release Notes HERE.
const composer = require('docker-composer');
.
const generatedYML = composer.generate(inputJSON);
{
"version" : "3",
"services" :
{
"nginx" : {
"ports" : [
"80"
],
"image" : "nginx:latest"
},
"http" : {
"ports" : [
"443"
],
"image" : "apache:latest"
}
}
}
---
version: "3"
services:
nginx:
ports:
- "80"
image: "nginx:latest"
http:
ports:
- "443"
image: "nginx:latest"
Copyright (c) 2015 Tibor Udvari. Released under the MIT license. See LICENSE for details.