3.7.1 • Published 3 years ago

@pubcore/node-docker-build v3.7.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

functions to build and deploy to a docker swarm, based on configuration

Prerequisites

  • latest docker installed (deamon is running and docker-compose does work)
  • latest nodejs/npm installed
  • git client installed
  • ssh access (optional over jump host) to deployment target, docker manager host

Configuration example: domain-config module (config.js)

'use strict'

module.exports = {
	baseImage:'node:10.15.1-alpine'
	compositions:['test'], //compostions of subdomains e.g. test.example.com
	target:{ //optional, target system (deploy)
		host:{host:'manager.example.com', key:'/home/admin/.ssh/id_rsa', user:'admin'},
		jump:{host:'connect.example.com', key:'~/.ssh/id_rsa', user:'admin'},
		home:'/home/admin',
		stackName: 'example',
		sudo:false //optional, prepend "sudo", if required for docker commands
	},
	configs:{ //optional, will be transfered to create docker config (deploy)
		'verdaccio-conf-v2':'verdaccio/conf/config.yaml'
	},
	detach: true //optional, if false std-out/-err is piped to current shell,
	push: true //optional, if false no docker-compose push will be executed,
	update: false //optional, if true "npm update" is used, else "npm install",
	forcePull: false //optional, if true --pull flag is set for docker build,
	buildKit: false //optional, if true docker build kit is enabled for build,
	retryOptions: {retries:1, minTimeout:30000} //retry options for updatePackages
}

Examples

1) In context of an CI/CD server: Build, push and deploy some images on a dev system composition (dev.example.com) Execution is done in background (spawn a script). If there is already running one, it will be killed. Output is piped to file within defined "logPath".

import {buildDeploy} from '@pubcore/node-docker-build'

buildDeploy({
	repo:'git@github.com:your-scope/compositions.git',
	domain:'dev.example.com',
	logPath:'~/'
})

In context of local compositions package, on developers machine: Build and push some images of a domain. Execution runns in foreground (detach=false), stdout to console

const {build} = require('@pubcore/node-docker-build')
build({
	configModule: resolve(__dirname, 'domains', 'host.docker.internal' , 'config'),
	detach: false,
})
3.7.1

3 years ago

3.7.0

3 years ago

3.6.4

4 years ago

3.6.3

4 years ago

3.6.2

4 years ago

3.6.1

4 years ago

3.6.0

4 years ago

3.5.3

4 years ago

3.5.2

4 years ago

3.5.1

4 years ago

3.5.0

4 years ago

3.4.2

4 years ago

3.4.1

4 years ago

3.3.0

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.3.0

4 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.13.2

5 years ago

1.13.1

5 years ago

1.13.0

5 years ago

1.12.4

5 years ago

1.12.3

5 years ago

1.12.1

5 years ago

1.12.0

5 years ago

1.11.0

5 years ago

1.10.1

5 years ago

1.10.0

5 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.13

5 years ago

1.1.12

5 years ago

1.1.11

5 years ago

1.1.10

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago