How to use Keystone V5 with pm2 or forever to make application up and running forever in production?
The simplest way is simply to have an ecosystem.config.js file like this:
module.exports = {
apps: [
{
name: "keystone-project",
cwd: "/path/to/keystone/project/",
script: "npm run build && npm start",
instances: 1,
autorestart: true,
max_memory_restart: "1G",
env: {
DATABASE_URL: "mongodb://localhost/keystone-project-db"
}
}
]
};
Then you'd simply start it with pm2 start ecosystem.config.js
This works fine for me, with one caveat: I have no successfully been able to run KeystoneJS in cluster mode.
Most helpful comment
The simplest way is simply to have an ecosystem.config.js file like this:
Then you'd simply start it with
pm2 start ecosystem.config.jsThis works fine for me, with one caveat: I have no successfully been able to run KeystoneJS in cluster mode.