#Automating Process Termination for Nuxt Server

7 messages · Page 1 of 1 (latest)

snow cargo
#

you should use something like supervisor

solar blaze
solar blaze
# snow cargo you should use something like supervisor

Like adding below to the yaml file?

- name: Install pm2
run: npm install pm2 -g
    
- name: Start or restart the Nuxt.js application with pm2
run: pm2 startOrRestart ecosystem.config.cjs --env production

My ecosystem.config.cjs:

module.exports = {
apps: [
  {
name: 'app name',
port: '3000',
exec_mode: 'cluster',
instances: 'max',
script: './.output/server/index.mjs',
  },
 ],
};
brisk gate
#

look up pm2 watch functionality

solar blaze
brisk gate
#

pm2 has watch capabilities which will automatically restart your app when files are changed