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

shipper

v0.1.0

Published

Scriptable deployment for Docker containers.

Downloads

4

Readme

shipper

Shipper is scriptable deployment for Docker containers.

Overview

Shipper abstracts your stack to servers and applications. A server is something that runs a Docker daemon. It could be an EC2 instance, a vagrant box, or even another Docker container. An application is just a Docker container.

Once you follow this abstraction, deploying and scaling your stack becomes incredibly simple. Instead of baking and deploying machine images like AMIs, you can just deploy an application to any running server.

Installation

$ npm install -g shipper

Usage

Images

Shipper currently uses Docker container images. You can generate an image by running:

$ docker export container > image.tar

Shipfiles

Shipfiles are standalone scripts for deploying your servers and applications. Simply create a file named Shipfile and run ship from the terminal. Shipfiles are written in CoffeeScript.

Shipfile

SIMPLE_SERVER =
  ec2:
    ami:             'ami-53aef83a'
    accessKey:       process.env.AWS_ACCESS_KEY
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
    region:          'us-east-1'
    type:            't1.micro'
    securityGroups:  [ 'shipper' ]
    ssh:
      user: 'ubuntu'
      name: 'shipper'
      key:  '~/shipper.pem'

ship 'release', ->
  boot 'ec2', SIMPLE_SERVER, (err, server) ->
    server.start 'docker_image.tar', ['echo', 'hello world'], (err) ->
      console.log "upload: #{err}"

    server.start 'docker_image.tar', ['echo', 'hello world'], (err) ->
      console.log "upload: #{err}"

Library

You can also use shipper as a node library. Just require('shipper') and use the same API as Shipfiles.

CoffeeScript Example

shipper = require 'shipper'
monitor = require './monitor'

monitor.on 'heavy traffic', ->
  shipper.boot 'ec2', WEB_SERVER, (err, server) ->
    server.start 'web server.tar', ['node', './server.js'], (err) ->
      console.log 'automatically scaled'

API

boot(provider, server, [overrides], callback)

  • provider String The provider (e.g. ec2) to use.
  • server Object
    • ec2 Object Amazon EC2 Configuration. (See below)
  • overrides Object Any additional overrides. (See below)
  • callback Function called when the server starts or an error occurs.
    • error Error
    • server Server object

Provisions a new server on the specified provider. The provider, server, and overrides arguments are split up so that you can define a semantic server and then provision it across different providers without changing your code.

Amazon EC2

  • ami String (See below)
  • accessKey String
  • secretAccessKey String
  • region String (e.g. us-east-1)
  • type String (e.g. t1.micro)
  • securityGroups Array Security groups to apply. (See below)
  • ssh Object SSH Configuration
    • user String SSH user
    • name String AWS key-pair name.
    • key String Path to private key file.
    • port Integer (default: 22)

Launches an Amazon EC2 instance of the given AMI, connects to it via SSH and creates a tunnel to the Docker daemon. Note that securityGroups must contain a group that allows inbound access to ssh.port.

The AMI must be running Linux 3.8 or above, and have an SSH and Docker daemon installed and configured.

Class: Server

Server is not intended to be used directly. Use the boot() method to create a new Server instance.

server.start(image, command, [options], callback)

  • image String Path to a Docker container image.
  • command Array The command to execute on the container.
  • callback Function called when the application has started.
    • error Error

The specified image will be uploaded to the server, and a new container will be created and started.

License

Copyright (c) 2013 Gerald Monaco. See the LICENSE.md file for license rights and limitations (MIT).