avatar

sunday

Sunday's Blog

  • 首页
主页 pm2以clude模式启动nextjs应用
文章

pm2以clude模式启动nextjs应用

发表于 2024-09-10 更新于 2024-09- 10
作者 sunday 已删除用户
0~1 分钟 阅读

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

nextjs, 软件使用
软件使用 nextjs
许可协议:  CC BY 4.0
分享

相关文章

8月 12, 2025

nextjs15使用ai sdk的一些问题

目前作者使用的版本: "@ai-sdk/openai": "^2.0.10", "@ai-sdk/react": "^2.0.10", "ai": "^5.0.10", "@modelcontextprotocol/sdk": "^1.17.2", "next": "15.4.5", 1.strea

7月 1, 2025

nextjs使用three.js写一个3D模型的查看器Viewer

直接上代码 // components/GLBViewer.js "use client"; import { useEffect, useRef, useState } from "react"; import * as THREE from "three"; import { OrbitCon

5月 3, 2025

nextjs15使用better-sqlite3的连接报错问题

1.出现如下错误 ⨯ Error: Could not locate the bindings file. Tried: 解决方法 我是使用pnpm包管理器,执行以下操作 首先安装node-gyp pnpm i node-gyp -D 然后执行 pnpm approve-builds 执行后会

下一篇

nextjs的一些报错及解决方法

上一篇

debian11/12安装图形界面xfce

最近更新

  • 解决群晖更新版本很慢,网络无法连接互联网的问题
  • 开发了个极简浏览器新标签页插件——miniTab
  • ios18 swiftUI 开发的一些问题
  • Cursor IDE中开发IOS应用——支持热更新
  • nginx + acme 不占用80端口申请证书

热门标签

nginx acme 强制跳转HTTPS nodejs 代理 mac 神器 vue3 工具 docker

目录

©2025 sunday. 保留部分权利。

使用 Halo 主题 Chirpy