diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..99fc35e --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,23 @@ +const path = require('path') + +// Load existing .env into process.env for PM2/Next start +require('dotenv').config({ path: path.join(__dirname, '.env') }) + +module.exports = { + apps: [ + { + name: 'profit-planet-frontend', + cwd: __dirname, + script: './node_modules/next/dist/bin/next', + args: `start -p ${process.env.PORT || 3000}`, + instances: 1, + exec_mode: 'fork', + autorestart: true, + watch: false, + time: true, + env: { + ...process.env, + }, + }, + ], +}