|
- const appName = process.env.APP_NAME || 'pc_nuxt'
- const host = process.env.HOST || '0.0.0.0'
- const port = process.env.PORT || '6888'
- const apiBase = process.env.NUXT_PUBLIC_API_BASE || 'https://api.aionline.cc'
- const env = {
- NODE_ENV: 'production',
- HOST: host,
- PORT: port,
- NITRO_HOST: host,
- NITRO_PORT: port,
- NUXT_PUBLIC_API_BASE: apiBase
- }
-
- module.exports = {
- apps: [
- {
- name: appName,
- script: '.output/server/index.mjs',
- cwd: __dirname,
- exec_mode: 'cluster',
- instances: Number(process.env.PM2_INSTANCES || 2),
- autorestart: true,
- watch: false,
- max_memory_restart: process.env.PM2_MAX_MEMORY || '512M',
- time: true,
- out_file: `./logs/${appName}-out.log`,
- error_file: `./logs/${appName}-error.log`,
- env,
- env_production: env
- }
- ]
- }
|