diff --git a/deploy/playbooks/setup.yml b/deploy/playbooks/setup.yml index d0f9ac5..c5ee5ee 100644 --- a/deploy/playbooks/setup.yml +++ b/deploy/playbooks/setup.yml @@ -71,8 +71,11 @@ { name: "impress-2020", cwd: "/srv/impress-2020/current", - script: "yarn", - args: "start", + // Instead of `yarn start`, we specify the `next` binary + // 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", exec_mode: "cluster", // We add `app` to the end of the filename, to avoid a pm2 diff --git a/package.json b/package.json index 459deb7..010f689 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ }, "scripts": { "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", "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/",