Giter Site home page Giter Site logo

krzysztofgawrys / ubuntu-docker-pm2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keymetrics/docker-pm2

0.0 2.0 0.0 27 KB

Node.js lightweight Docker image including the PM2 runtime

Home Page: https://hub.docker.com/r/keymetrics/pm2-docker-alpine/

JavaScript 14.29% Shell 85.71%

ubuntu-docker-pm2's Introduction

keymetrics/pm2-docker-alpine

https://travis-ci.org/keymetrics/pm2-docker-alpine

Node.js lightweight Docker image including the PM2 runtime for production applications.

This Docker image in association with PM2, increase application uptime, increase performance (spawn multiple processes and load-balance network query without any code change) and allow graceful state change, adapted to production environment.

Usage

$ docker pull keymetrics/pm2-docker-alpine

Versions available:

  • keymetrics/pm2-docker-alpine:latest with Node.js 6
  • keymetrics/pm2-docker-alpine:4 with Node.js 4
  • keymetrics/pm2-docker-alpine:0.12 with Node.js 0.12

These images are automatically built from the Docker hub based on this Github repository branch arrangement.

Hub link

Running the container

Make sure you declared a process file called process.yml, this file will be started by PM2.

# Get example app
$ git clone https://github.com/keymetrics/pm2-docker-alpine
# Run example app, mounted as a volume
$ docker run -p 80:3000 -v `pwd`/example_app:/app keymetrics/pm2-docker-alpine

For Keymetrics linking you can set the extra env variables:

-e "KEYMETRICS_SECRET=YYY
-e "KEYMETRICS_PUBLIC=XXX"
-e "INSTANCE_NAME=hostname"

Log output

Append to pm2-docker CMD directive:

  • --json to output logs in JSON
  • --format to output logs in key=val style
  • --raw to display logs in raw format

Actions

Monitoring CPU/Usage of each process

$ docker exec -it <container_id> pm2 monit

Listing managed processes

$ docker exec -it <container_id> pm2 list

Get more information about a process

$ docker exec -it <container_id> pm2 show <app_name>

0sec downtime reload all applications

$ docker exec -it <container_id> pm2 reload all

Automatically synchronize your application with git

Add into your Dockerfile:

RUN pm2 install pm2-auto-pull

Or try it:

$ docker exec -it <container_id> pm2 install pm2-auto-pull

Make sure the .git is present in your application source folder.

License

MIT

ubuntu-docker-pm2's People

Contributors

krzysztofgawrys avatar unitech avatar

Watchers

 avatar  avatar

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.