const path = require('path');

module.exports = {
    apps: [{
        name: 'gymflow',
        script: './dist/index.js',
        cwd: './server',
        instances: 1,
        autorestart: true,
        watch: false,
        max_memory_restart: '1G',
        env: {
            NODE_ENV: 'production',
            APP_MODE: 'prod',
            PORT: 3003,
            DATABASE_URL: 'file:./prod.db', // Consistent with the npx prisma db push command
            DATABASE_URL_PROD: 'file:./prod.db',
            // Actually, prisma runs from where schema is or based on env.
            // Let's assume the DB is in the root or server dir.
            // In package.json: "start:prod": "cross-env APP_MODE=prod DATABASE_URL=file:./prod.db ... src/index.ts"
            // If CWD is ./server, then ./prod.db is inside server/prod.db.
        },
        env_production: {
            NODE_ENV: 'production'
        }
    }]
};
