6a23e79f4c
dev deploys to /opt/dukang-staging (819x, *-test domains); main deploys to production. Staging uses full Mock with shared WeChat app ids. Co-authored-by: Cursor <cursoragent@cursor.com>
71 lines
1.8 KiB
JavaScript
71 lines
1.8 KiB
JavaScript
/** PM2 ecosystem — 杜康好客生产部署 */
|
||
const APP_ROOT = process.env.APP_ROOT || '/opt/dukang';
|
||
|
||
module.exports = {
|
||
apps: [
|
||
{
|
||
name: 'dukang-api',
|
||
cwd: `${APP_ROOT}/server/dukang-api`,
|
||
script: 'dist/main.js',
|
||
instances: 1,
|
||
exec_mode: 'fork',
|
||
env: {
|
||
NODE_ENV: 'production',
|
||
APP_ENV: 'production',
|
||
PORT: 8090,
|
||
},
|
||
},
|
||
{
|
||
// C 端改为 mini-user H5 产物(端口仍 8091,进程名保持兼容旧脚本)
|
||
// cleanUrls:false 见 apps/mini-user/serve.json(发版时复制到 dist/)
|
||
// 否则 /pages/x/index 会被 301 成 /pages/x,Location 缺 /user 前缀 → Taro 白屏
|
||
name: 'dukang-h5-user',
|
||
cwd: `${APP_ROOT}/apps/mini-user`,
|
||
script: 'npx',
|
||
args: 'serve dist -l 8091 -c serve.json',
|
||
interpreter: 'none',
|
||
instances: 1,
|
||
exec_mode: 'fork',
|
||
},
|
||
{
|
||
name: 'dukang-h5-shop',
|
||
cwd: `${APP_ROOT}/apps/h5-shop`,
|
||
script: 'npx',
|
||
args: 'serve -s dist -l 8092',
|
||
interpreter: 'none',
|
||
instances: 1,
|
||
exec_mode: 'fork',
|
||
},
|
||
{
|
||
name: 'dukang-h5-partner',
|
||
cwd: `${APP_ROOT}/apps/h5-partner`,
|
||
script: 'npx',
|
||
args: 'serve -s dist -l 8093',
|
||
interpreter: 'none',
|
||
instances: 1,
|
||
exec_mode: 'fork',
|
||
},
|
||
{
|
||
name: 'dukang-admin-web',
|
||
cwd: `${APP_ROOT}/apps/admin-web`,
|
||
script: 'npx',
|
||
args: 'serve -s dist -l 8094',
|
||
interpreter: 'none',
|
||
instances: 1,
|
||
exec_mode: 'fork',
|
||
},
|
||
{
|
||
name: 'dukang-deploy-webhook',
|
||
cwd: `${APP_ROOT}/deploy`,
|
||
script: 'webhook-server.mjs',
|
||
interpreter: 'node',
|
||
instances: 1,
|
||
exec_mode: 'fork',
|
||
env: {
|
||
NODE_ENV: 'production',
|
||
APP_ENV: 'production',
|
||
},
|
||
},
|
||
],
|
||
};
|