npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pubcore/node-docker-build

v3.7.1

Published

Scripts to build and deploy pubcore compositions

Downloads

8

Readme

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:'[email protected]: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,
})