文章

pm2以clude模式启动nextjs应用

1.添加如下文件pm2Start.json在根目录

{
  "apps" : [
    {
      "name" : "next app",
      "script" : "node_modules/next/dist/bin/next",
      "args" : "start --port 3000",
      "exec_mode" : "cluster_mode",
      "instances" : 2, #服务器有多少核心就填多少就可以了
    }
  ]
}

2.启动脚本

pm2 start pm2Start.json

许可协议:  CC BY 4.0