初始化游戏小组管理系统后端项目
- 基于 NestJS + TypeScript + MySQL + Redis 架构 - 完整的模块化设计(认证、用户、小组、游戏、预约等) - JWT 认证和 RBAC 权限控制系统 - Docker 容器化部署支持 - 添加 CLAUDE.md 项目开发指南 - 配置 .gitignore 忽略文件 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
35
ecosystem.config.js
Normal file
35
ecosystem.config.js
Normal file
@@ -0,0 +1,35 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'gamegroup-backend',
|
||||
script: './dist/main.js',
|
||||
instances: 'max', // 使用所有CPU核心
|
||||
exec_mode: 'cluster', // 集群模式
|
||||
env: {
|
||||
NODE_ENV: 'development',
|
||||
},
|
||||
env_production: {
|
||||
NODE_ENV: 'production',
|
||||
},
|
||||
// 日志配置
|
||||
error_file: './logs/pm2-error.log',
|
||||
out_file: './logs/pm2-out.log',
|
||||
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
merge_logs: true,
|
||||
|
||||
// 进程管理
|
||||
watch: false, // 生产环境不启用文件监视
|
||||
max_memory_restart: '500M', // 内存超过500M自动重启
|
||||
|
||||
// 自动重启配置
|
||||
autorestart: true,
|
||||
max_restarts: 10,
|
||||
min_uptime: '10s',
|
||||
|
||||
// 优雅关闭
|
||||
kill_timeout: 5000,
|
||||
wait_ready: true,
|
||||
listen_timeout: 3000,
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user