rocdk890 / node-pm2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker-node-pm2

Docker container with node and pm2.

Inspired on dashersw/docker-node-pm2.

Features

  • Allows to pass the path to the application declaration file, or the startup js file.
  • Allows to pass parameters to pm2 (and through it, to the app itself).
  • Can choose from different versions of node.
  • Volumes for the application code, and for the logs.

Usage

docker run -d \
    --name my-awesome-app \
    -e APP=process.json \
    -e PARAMETERS="--watch" \
    -v /path/to/app/source:/var/app \
    -v /path/to/store/logs:/var/log/app \
    -p 3000:3000 \
    devsu/node-pm2:latest

Explanation

  • Environment variables
  • The code should be provided using a volume connected to /var/app.
  • Optionally, the logs can be connected using a volume connected to /var/log/app.
  • You might want to expose the 3000 port, to make the app. visible.
  • Change the image tag to use a different node version (e.g. node4).# node-pm2

About


Languages

Language:Shell 100.0%