Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devsu/docker-node-pm2
Docker container with node and pm2
https://github.com/devsu/docker-node-pm2
Last synced: about 2 months ago
JSON representation
Docker container with node and pm2
- Host: GitHub
- URL: https://github.com/devsu/docker-node-pm2
- Owner: devsu
- License: gpl-3.0
- Created: 2016-04-03T20:34:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-09-01T18:29:57.000Z (over 4 years ago)
- Last Synced: 2023-02-28T23:06:57.071Z (almost 2 years ago)
- Language: Dockerfile
- Size: 19.5 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-node-pm2
Docker container with node and pm2.Inspired on [dashersw/docker-node-pm2](https://github.com/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](http://pm2.keymetrics.io/docs/usage/application-declaration/). 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`).