composex

1.1.3 • Public • Published

npm version license

composex

This tool let you add includes section for docker compose 2 which allow you to extends or combine multiple docker compose files.

What is it

common.yml

    version: '2'
    services:
      nginx:
        build: .
        links:
          - db
 
      db:
        image: mongo:3.0.14

web.yml

    version: '2'
    includes:
      nsA: "/path/to/common.yml"
    services:
      web:
        image: thanhpk/web:v2.0.4
      links:
        nsA.nginx: nginx
        nsA.db: db
$ composex web.yml

output

    version: '2'
    includes:
      nsA: "/path/to/common.yml"
    services:
      web:
        image: thanhpk/web:v2.0.4
      links:
        nsA.nginx: nginx
        nsA.db: db
        
      nsA.nginx:
        build: .
        links:
          nsA.db: db
 
      nsA.db:
        image: mongo:3.0.14

what about docker composer extends

docker compose currently don't let you extend a service which has links (#1617)

install

npm install -g composex

Usage

composex take only one parameter, the path to the yml, the path could be absolute path or relative path in the file system, or the url (http, https) to the yaml file

License

This software is licensed under the terms of the MIT license. See the LICENSE.md files.

Questions

If you have any questions, please feel free to send me an email at thanhpk@live.com.

Readme

Keywords

Package Sidebar

Install

npm i composex

Weekly Downloads

1

Version

1.1.3

License

MIT

Last publish

Collaborators

  • thanhpk