Files
leaudit-platform-frontend/ecosystem.config.cjs
T

125 lines
4.0 KiB
JavaScript

// ecosystem.config.cjs - CommonJS 版本
// 多客户端部署配置:支持3个不同地区客户端通过不同端口访问
module.exports = {
apps: [
// 主服务 - 生产环境 (端口: 51703)
{
name: 'docreview-main',
script: 'node',
args: [
'-r', 'dotenv/config',
'./node_modules/.bin/remix-serve',
'./build/server/index.js'
],
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production',
PORT: 51703,
CLIENT_ID: 'main'
},
env_testing: {
NODE_ENV: 'testing',
PORT: 51703,
CLIENT_ID: 'main'
},
error_file: './logs/main-err.log',
out_file: './logs/main-out.log',
log_file: './logs/main-combined.log',
time: true
},
// 客户端A - 反向代理服务 (端口: 51701)
{
name: 'docreview-client-a',
script: 'node',
args: [
'-r', 'dotenv/config',
'./node_modules/.bin/remix-serve',
'./build/server/index.js'
],
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production',
PORT: 51701,
CLIENT_ID: 'client-a',
PROXY_TARGET: 'http://10.79.97.17:51703'
},
env_testing: {
NODE_ENV: 'testing',
PORT: 51701,
CLIENT_ID: 'client-a',
PROXY_TARGET: 'http://10.79.97.17:51703'
},
error_file: './logs/client-a-err.log',
out_file: './logs/client-a-out.log',
log_file: './logs/client-a-combined.log',
time: true
},
// 客户端B - 反向代理服务 (端口: 51702)
{
name: 'docreview-client-b',
script: 'node',
args: [
'-r', 'dotenv/config',
'./node_modules/.bin/remix-serve',
'./build/server/index.js'
],
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production',
PORT: 51702,
CLIENT_ID: 'client-b',
PROXY_TARGET: 'http://10.79.97.17:51703'
},
env_testing: {
NODE_ENV: 'testing',
PORT: 51702,
CLIENT_ID: 'client-b',
PROXY_TARGET: 'http://10.79.97.17:51703'
},
error_file: './logs/client-b-err.log',
out_file: './logs/client-b-out.log',
log_file: './logs/client-b-combined.log',
time: true
},
// 客户端C - 反向代理服务 (端口: 51704)
{
name: 'docreview-client-c',
script: 'node',
args: [
'-r', 'dotenv/config',
'./node_modules/.bin/remix-serve',
'./build/server/index.js'
],
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production',
PORT: 51704,
CLIENT_ID: 'client-c',
PROXY_TARGET: 'http://10.79.97.17:51703'
},
env_testing: {
NODE_ENV: 'testing',
PORT: 51704,
CLIENT_ID: 'client-c',
PROXY_TARGET: 'http://10.79.97.17:51703'
},
error_file: './logs/client-c-err.log',
out_file: './logs/client-c-out.log',
log_file: './logs/client-c-combined.log',
time: true
}
],
};