Ninety Percent Muffin

    docker-composer
    TypeScript icon, indicating that this package has built-in type declarations

    4.1.1 • Public • Published

    docker-composer

    Generate Docker Compose descriptor from a JSON document.

    Node.js CI npm version CodeQL

    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.1 (27.03.2022)

    • Maintenance release, 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.

    Install

    npm i docker-composer

    DownloadsWeekly Downloads

    56

    Version

    4.1.1

    License

    MIT

    Unpacked Size

    29.1 kB

    Total Files

    8

    Last publish

    Collaborators

    • tudvari