- Add Dockerfile with AlmaLinux 9 base, Nginx reverse proxy, and PM2 - Support Node.js versions 18, 20, 22 with automated installation - Implement memory-optimized configuration (256MB minimum, 512MB recommended) - Add Memcached session storage for development environments - Create comprehensive documentation (README, USER-GUIDE, MEMORY-GUIDE, CLAUDE.md) - Include example applications (simple website and REST API) - Add Gitea CI/CD pipeline for automated multi-version builds - Provide local development script with helper utilities - Implement health monitoring, log rotation, and backup systems 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
836 B
JavaScript
31 lines
836 B
JavaScript
module.exports = {
|
|
apps: [{
|
|
name: 'node-app',
|
|
script: 'index.js',
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '256M', // Restart if app uses more than 256MB
|
|
kill_timeout: 3000,
|
|
wait_ready: true,
|
|
listen_timeout: 3000,
|
|
env: {
|
|
NODE_ENV: 'development',
|
|
PORT: 3000,
|
|
NODE_OPTIONS: '--max-old-space-size=200' // Limit V8 heap to 200MB
|
|
},
|
|
env_production: {
|
|
NODE_ENV: 'production',
|
|
PORT: 3000,
|
|
NODE_OPTIONS: '--max-old-space-size=200'
|
|
},
|
|
log_file: '/home/myuser/logs/nodejs/app.log',
|
|
error_file: '/home/myuser/logs/nodejs/error.log',
|
|
out_file: '/home/myuser/logs/nodejs/out.log',
|
|
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
|
log_type: 'json',
|
|
merge_logs: true,
|
|
max_restarts: 5,
|
|
min_uptime: '10s'
|
|
}]
|
|
}; |