Giter Club home page Giter Club logo

chef-cookbook-pm2's Introduction

pm2 Cookbook

This Chef cookbook provides recipes to install and setup node.js, pm2 and provides an LWRP for easy setup of node apps managed by pm2.

Requirements

The only requirement is the nodejs cookbook

Attributes

pm2::default

Key Type Description Default
['pm2']['app_name'] String A name for the node app app
['pm2']['port'] String Port for the backend 8080
['pm2']['path'] String Path to the root of the node app /var/www/app
['pm2']['user'] String User to run the node app as nobody
['pm2']['group'] String Group to run the node app as nobody
['pm2']['js'] String Main JS file to run app.coffee

Usage

pm2::default

Installs node.js, pm2, and a pm2 application. You must set the pm2 attributes for this recipe to work and it assumes you are running only a single application with pm2.

pm2::nodejs

Installs node.js using the nodejs::default recipe.

pm2::pm2

Installs pm2 and associated packages.

LWRP: pm2_app

This LWRP provides a simple way to deploy multiple applications with pm2. Usage is as follows:

pm2_app 'my_app_1' do
    path    '/var/www/my_app_1'
    js      'main.js'
    user    'nobody'
    group   'nobody'
    port    '8080'
    action  :create
end

This will setup a node.js application with pm2 called "my_app_1" with your code located at the path specified. Pm2 will run the code as the specified user/group and setup a listener on the specified port. If these attributes aren't specified, it will default to the node pm2 attributes.

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors: Joe Richards [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.