Sign inSign up

devsu/node-pm2

By devsu

•Updated about 6 years ago

Docker with node and pm2.

Image
0

1.3K

devsu/node-pm2 repository overview

⁠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.yml \
    -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
    • APP: application declaration file⁠. The default value is process.yml. You could directly call the script as well. (e.g. APP=app.js).
    • PARAMETERS: optional parameters to pass to pm2.
  • 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).

Tag summary

Content type

Image

Digest

Size

341.3 MB

Last updated

over 7 years ago

docker pull devsu/node-pm2