nuxt3项目在宝塔面板发布流程

项目build打包后,将.output压缩成一个压缩文件,将压缩文件上传到服务器网站根目录中再解压。

在网站根目录下新建ecosystem.config.cjs

module.exports = {
  apps: [
    {
      name: '项目名',  // 更改项目名
      port: '3000',  // 更改默认端口
      exec_mode: 'cluster',
      instances: 'max',
      script: './.output/server/index.mjs'
    }
  ]
}

在宝塔的网站里的node项目里点添加项目,选PM2项目,添加方式选从文件/内容添加,配置文件选刚才创建的这个ecosystem.config.cjs文件,其它的就按正常需要的填就行。

image2
image1

摘自:https://blog.csdn.net/pandafucker/article/details/147500193