192 lines
6.2 KiB
JavaScript
192 lines
6.2 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',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./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
|
|
},
|
|
|
|
// 客户端C - 反向代理服务 (端口: 51704)
|
|
{
|
|
name: 'docreview-client-c',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
// './node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51704,
|
|
CLIENT_ID: 'client-c',
|
|
API_PORT_CONFIG: '51704'
|
|
},
|
|
env_testing: {
|
|
NODE_ENV: 'testing',
|
|
PORT: 51704,
|
|
CLIENT_ID: 'client-c',
|
|
API_PORT_CONFIG: '51704'
|
|
},
|
|
error_file: './logs/client-c-err.log',
|
|
out_file: './logs/client-c-out.log',
|
|
log_file: './logs/client-c-combined.log',
|
|
time: true
|
|
},
|
|
// 客户端D - 独立服务 (端口: 51705)
|
|
{
|
|
name: 'docreview-client-d',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
// './node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51705,
|
|
CLIENT_ID: 'client-d',
|
|
API_PORT_CONFIG: '51705'
|
|
},
|
|
env_testing: {
|
|
NODE_ENV: 'testing',
|
|
PORT: 51705,
|
|
CLIENT_ID: 'client-d',
|
|
API_PORT_CONFIG: '51705'
|
|
},
|
|
error_file: './logs/client-d-err.log',
|
|
out_file: './logs/client-d-out.log',
|
|
log_file: './logs/client-d-combined.log',
|
|
time: true
|
|
},
|
|
// 客户端E - 独立服务 (端口: 51706)
|
|
{
|
|
name: 'docreview-client-e',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
// './node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51706,
|
|
CLIENT_ID: 'client-e',
|
|
API_PORT_CONFIG: '51706'
|
|
},
|
|
env_testing: {
|
|
NODE_ENV: 'testing',
|
|
PORT: 51706,
|
|
CLIENT_ID: 'client-e',
|
|
API_PORT_CONFIG: '51706'
|
|
},
|
|
error_file: './logs/client-e-err.log',
|
|
out_file: './logs/client-e-out.log',
|
|
log_file: './logs/client-e-combined.log',
|
|
time: true
|
|
},
|
|
// 客户端F - 独立服务 (端口: 51707)
|
|
{
|
|
name: 'docreview-client-f',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
//'./node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51707,
|
|
CLIENT_ID: 'client-f',
|
|
API_PORT_CONFIG: '51707'
|
|
},
|
|
env_testing: {
|
|
NODE_ENV: 'testing',
|
|
PORT: 51707,
|
|
CLIENT_ID: 'client-f',
|
|
API_PORT_CONFIG: '51707'
|
|
},
|
|
error_file: './logs/client-f-err.log',
|
|
out_file: './logs/client-f-out.log',
|
|
log_file: './logs/client-f-combined.log',
|
|
time: true
|
|
},
|
|
// 客户端G - 独立服务 (端口: 51708)
|
|
{
|
|
name: 'docreview-client-g',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
//'./node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51708,
|
|
CLIENT_ID: 'client-g',
|
|
API_PORT_CONFIG: '51708'
|
|
},
|
|
env_testing: {
|
|
NODE_ENV: 'testing',
|
|
PORT: 51708,
|
|
CLIENT_ID: 'client-g',
|
|
API_PORT_CONFIG: '51708'
|
|
},
|
|
error_file: './logs/client-g-err.log',
|
|
out_file: './logs/client-g-out.log',
|
|
log_file: './logs/client-g-combined.log',
|
|
time: true
|
|
}
|
|
],
|
|
}; |