194 lines
7.0 KiB
JavaScript
194 lines
7.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',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js',
|
|
'--port', '51703'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51703,
|
|
CLIENT_ID: 'main',
|
|
API_PORT_CONFIG: '51703',
|
|
// 添加这些环境变量确保客户端能获取到
|
|
NEXT_PUBLIC_NODE_ENV: 'production',
|
|
NEXT_PUBLIC_PORT: '51703',
|
|
NEXT_PUBLIC_CLIENT_ID: 'main',
|
|
NEXT_PUBLIC_API_PORT_CONFIG: '51703'
|
|
},
|
|
error_file: './logs/main-err.log',
|
|
out_file: './logs/main-out.log',
|
|
log_file: './logs/main-combined.log',
|
|
time: true
|
|
},
|
|
|
|
// 客户端潮州 - 反向代理服务 (端口: 51704)
|
|
{
|
|
name: 'docreview-client-chaozhou',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
// './node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js',
|
|
'--port', '51704'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51704,
|
|
CLIENT_ID: 'chaozhou',
|
|
API_PORT_CONFIG: '51704',
|
|
// 添加这些环境变量确保客户端能获取到
|
|
NEXT_PUBLIC_NODE_ENV: 'production',
|
|
NEXT_PUBLIC_PORT: '51704',
|
|
NEXT_PUBLIC_CLIENT_ID: 'chaozhou',
|
|
NEXT_PUBLIC_API_PORT_CONFIG: '51704'
|
|
},
|
|
error_file: './logs/chaozhou-err.log',
|
|
out_file: './logs/chaozhou-out.log',
|
|
log_file: './logs/chaozhou-combined.log',
|
|
time: true
|
|
},
|
|
// 客户端揭阳 - 独立服务 (端口: 51705)
|
|
{
|
|
name: 'docreview-client-jieyang',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
// './node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js',
|
|
'--port', '51705'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51705,
|
|
CLIENT_ID: 'jieyang',
|
|
API_PORT_CONFIG: '51705',
|
|
// 添加这些环境变量确保客户端能获取到
|
|
NEXT_PUBLIC_NODE_ENV: 'production',
|
|
NEXT_PUBLIC_PORT: '51705',
|
|
NEXT_PUBLIC_CLIENT_ID: 'jieyang',
|
|
NEXT_PUBLIC_API_PORT_CONFIG: '51705'
|
|
},
|
|
error_file: './logs/jieyang-err.log',
|
|
out_file: './logs/jieyang-out.log',
|
|
log_file: './logs/jieyang-combined.log',
|
|
time: true
|
|
},
|
|
// 客户端云浮 - 独立服务 (端口: 51706)
|
|
{
|
|
name: 'docreview-client-yunfu',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
// './node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js',
|
|
'--port', '51706'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51706,
|
|
CLIENT_ID: 'yunfu',
|
|
API_PORT_CONFIG: '51706',
|
|
// 添加这些环境变量确保客户端能获取到
|
|
NEXT_PUBLIC_NODE_ENV: 'production',
|
|
NEXT_PUBLIC_PORT: '51706',
|
|
NEXT_PUBLIC_CLIENT_ID: 'yunfu',
|
|
NEXT_PUBLIC_API_PORT_CONFIG: '51706'
|
|
},
|
|
error_file: './logs/yunfu-err.log',
|
|
out_file: './logs/yunfu-out.log',
|
|
log_file: './logs/yunfu-combined.log',
|
|
time: true
|
|
},
|
|
// 客户端梅州 - 独立服务 (端口: 51707)
|
|
{
|
|
name: 'docreview-client-meizhou',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
//'./node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js',
|
|
'--port', '51707'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51707,
|
|
CLIENT_ID: 'meizhou',
|
|
API_PORT_CONFIG: '51707',
|
|
// 添加这些环境变量确保客户端能获取到
|
|
NEXT_PUBLIC_NODE_ENV: 'production',
|
|
NEXT_PUBLIC_PORT: '51707',
|
|
NEXT_PUBLIC_CLIENT_ID: 'meizhou',
|
|
NEXT_PUBLIC_API_PORT_CONFIG: '51707'
|
|
},
|
|
error_file: './logs/meizhou-err.log',
|
|
out_file: './logs/meizhou-out.log',
|
|
log_file: './logs/meizhou-combined.log',
|
|
time: true
|
|
},
|
|
// 客户端省局 - 独立服务 (端口: 51708)
|
|
{
|
|
name: 'docreview-client-province',
|
|
script: 'node',
|
|
args: [
|
|
'-r', 'dotenv/config',
|
|
//'./node_modules/.bin/remix-serve',
|
|
'./node_modules/@remix-run/serve/dist/cli.js',
|
|
'./build/server/index.js',
|
|
'--port', '51708'
|
|
],
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '1G',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 51708,
|
|
CLIENT_ID: 'province',
|
|
API_PORT_CONFIG: '51708',
|
|
// 添加这些环境变量确保客户端能获取到
|
|
NEXT_PUBLIC_NODE_ENV: 'production',
|
|
NEXT_PUBLIC_PORT: '51708',
|
|
NEXT_PUBLIC_CLIENT_ID: 'province',
|
|
NEXT_PUBLIC_API_PORT_CONFIG: '51708'
|
|
},
|
|
error_file: './logs/province-err.log',
|
|
out_file: './logs/province-out.log',
|
|
log_file: './logs/province-combined.log',
|
|
time: true
|
|
}
|
|
],
|
|
}; |