fix:优化pm2配置项
This commit is contained in:
43
ecosystem.config.cjs
Normal file
43
ecosystem.config.cjs
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* PM2 进程配置:API + 爬虫(GDELT/RSS uvicorn 服务)
|
||||
* 用法:
|
||||
* pm2 start ecosystem.config.cjs # 启动全部
|
||||
* pm2 restart ecosystem.config.cjs # 重启全部
|
||||
* pm2 stop ecosystem.config.cjs # 停止全部
|
||||
* pm2 logs nsa_api / pm2 logs nsa_crawler
|
||||
* 需 .env 时可在启动前 source .env,或在应用内用 dotenv 加载。
|
||||
*/
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'nsa_api',
|
||||
script: 'server/index.js',
|
||||
cwd: __dirname,
|
||||
interpreter: 'node',
|
||||
instances: 1,
|
||||
autorestart: true,
|
||||
watch: false,
|
||||
max_memory_restart: '300M',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
API_PORT: 3001,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'nsa_crawler',
|
||||
script: 'crawler/run_uvicorn.sh',
|
||||
cwd: __dirname,
|
||||
interpreter: 'bash',
|
||||
instances: 1,
|
||||
autorestart: true,
|
||||
watch: false,
|
||||
max_memory_restart: '300M',
|
||||
env: {
|
||||
CLEANER_AI_DISABLED: '1',
|
||||
PARSER_AI_DISABLED: '0',
|
||||
GDELT_DISABLED: '1',
|
||||
RSS_INTERVAL_SEC: '60',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user