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

dockrr

v0.0.3

Published

An npm package for generating Dockerfile and building container image of Node.js applications

Downloads

7

Readme

dockrr

Build Status Coverage Status dockrr is an an NPM package for auto generating Dockerfile, building docker image, running and stopping the docker container in Node.js.

Installation

npm install dockrr --save-dev

Configuration

  1. Setup the dockrr config file in your application package.json file
...

"dockrr":{
    "cmd": "node index.js",
    "expose": 3000,
    "env": [
        { "name": "name 1" },
        { "metadata": "meta data 1" },
        { "path": "Log Path 1" }
      ],
    "label": [
        { "version": "1.0" }, 
        { "description": "A sample label" },
        { "maintainer": "[email protected]" }
      ],
    "workdir": "/app"
  },
  1. Add script to generate Dockerfile, build docker image, start and stop docker container in your scripts section of package.json file
....

"scripts": {
    "start": "node index.js",
    "dockrr-generate": "node ./node_modules/dockrr generate",
    "dockrr-build": "node ./node_modules/dockrr build",
    "dockrr-run": "node ./node_modules/dockrr run",
    "dockrr-stop": "node ./node_modules/dockrr stop"
  },

Alternatively, we can use dockrr aliases such as

....

"scripts": {
    "start": "node index.js",
    "dockrr-generate": "node ./node_modules/dockrr g",
    "dockrr-build": "node ./node_modules/dockrr b",
    "dockrr-run": "node ./node_modules/dockrr r",
    "dockrr-stop": "node ./node_modules/dockrr s"
  },

Usage

  1. To generate Dockerfile for your application, run
npm run dockrr-generate
  1. To build docker image using the generated Dockerfile, run
npm run dockrr-build
  1. To run the docker container using the built image, run
npm run dockrr-run

Visit the application on your web browser on http://localhost:<port number>/

  1. To stop the docker container, run
npm run dockrr-stop

dockrr config commands

| Commands | Description | Type | Required | | ------------- |:------------------------------------------------------------------|:--------------------| :---------| | cmd | Command that docker will use to start your application | String | True | | expose | The application port which you want the container to run on | Integer | True | | env | The environment variables for docker | Array of Objects | False | | label | Key value pair of metadata to the image | Array of Objects | False | | workdir | The working directory in the Dockerfile | String | False |

ISSUES

To report an issue or give feedback, Click link Issues and Feedback

Contributing

We are more than happy to have you contribute to this project.

License

MIT