pm2 all the things on ur dev box
Apparently you can use pm2 to run anything. I think this makes setting up your dev environment with databases etc pretty easy. Here’s an example of using pm2 to run a development elasticsearch server.
npm install -g pm2
Download and extract elasticsearch somewhere, cd into its bin directory and fire up a dev server with:
pm2 start elasticsearch --interpreter sh
We set the interpreter to sh because elasticsearch in the bin directory is a shell script.
Why using pm2 for dev rocks
- It’s easy to watch your logs for errors
- It’s easy to remember how to stop and start your dev stuff, especially if you use an ecosystem.json
- Takes up less disk space than containers
- Don’t have to map ports to various containers
So if you, like me, have the flexibility to do whatever you want on your dev machine, why not take the easy road?