chore: add deployment configuration for PM2 and production environment
- Add deploy.sh script for automated deployment via rsync - Add ecosystem.config.js for PM2 process management (2 instances) - Add .env.production.example as production env template - Update config.module.ts to support .env.production file - Add 'pnpm run deploy' script to package.json
This commit is contained in:
27
ecosystem.config.js
Normal file
27
ecosystem.config.js
Normal file
@@ -0,0 +1,27 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'mememind-server',
|
||||
script: 'dist/main.js',
|
||||
instances: 2,
|
||||
exec_mode: 'cluster',
|
||||
autorestart: true,
|
||||
watch: false,
|
||||
max_memory_restart: '1G',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
PORT: 3000,
|
||||
},
|
||||
env_production: {
|
||||
NODE_ENV: 'production',
|
||||
PORT: 3000,
|
||||
},
|
||||
error_file: './logs/error.log',
|
||||
out_file: './logs/out.log',
|
||||
log_file: './logs/combined.log',
|
||||
time: true,
|
||||
merge_logs: true,
|
||||
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user