Fix pm2 monitoring
Okay huh, while digging a bit into another issue, I found what was wrong with our config and pm2's built-in monitoring! You can't use `yarn start`, because the wrapper script breaks its ability to look inside and see what's happening. I also removed the compiler flag thing from the `start` script in `package.json`, because I think it's redundant? There's no compilation to be done in a live server. I think I might remove monit after this? It's nice extra resilience in a sense, but it feels like extra complexity when it's doing the job `pm2` is supposed to do. (And tbh I've almost never heard of nginx crashing, and if it does it's probably a scenario worth investigating by hand.)
This commit is contained in:
parent
3f07933f7a
commit
d17263139e
2 changed files with 6 additions and 3 deletions
|
@ -71,8 +71,11 @@
|
||||||
{
|
{
|
||||||
name: "impress-2020",
|
name: "impress-2020",
|
||||||
cwd: "/srv/impress-2020/current",
|
cwd: "/srv/impress-2020/current",
|
||||||
script: "yarn",
|
// Instead of `yarn start`, we specify the `next` binary
|
||||||
args: "start",
|
// directly, because it helps pm2 monitor our app correctly.
|
||||||
|
// https://github.com/vercel/next.js/discussions/10675#discussioncomment-34615
|
||||||
|
script: "./node_modules/.bin/next",
|
||||||
|
args: "start --port=3000",
|
||||||
instances: "max",
|
instances: "max",
|
||||||
exec_mode: "cluster",
|
exec_mode: "cluster",
|
||||||
// We add `app` to the end of the filename, to avoid a pm2
|
// We add `app` to the end of the filename, to avoid a pm2
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"start": "TS_NODE_COMPILER=typescript-cached-transpile next start",
|
"start": "next start",
|
||||||
"dev": "yarn build-cached-data && REACT_APP_IMPRESS_LOG_IN_AS=$IMPRESS_LOG_IN_AS TS_NODE_COMPILER=typescript-cached-transpile next dev",
|
"dev": "yarn build-cached-data && REACT_APP_IMPRESS_LOG_IN_AS=$IMPRESS_LOG_IN_AS TS_NODE_COMPILER=typescript-cached-transpile next dev",
|
||||||
"build": "yarn build-cached-data && next build",
|
"build": "yarn build-cached-data && next build",
|
||||||
"vercel-build": "yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/",
|
"vercel-build": "yum install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/",
|
||||||
|
|
Loading…
Reference in a new issue