优化图文页

This commit is contained in:
2026-04-28 17:11:42 +08:00
parent 674c202264
commit 040273586b
69 changed files with 3939 additions and 2302 deletions
+35 -33
View File
@@ -1,37 +1,39 @@
const path = require('path');
const dotenv = require('dotenv');
const path = require("path");
const dotenv = require("dotenv");
const instances = Number.parseInt(process.env.WEB_CONCURRENCY ?? '1', 10) || 1;
const { parsed: envFromFile = {} } = dotenv.config({ path: path.join(__dirname, '.env') });
const instances = Number.parseInt(process.env.WEB_CONCURRENCY ?? "1", 10) || 1;
const { parsed: envFromFile = {} } = dotenv.config({
path: path.join(__dirname, ".env"),
});
module.exports = {
apps: [
{
name: "DouyinArchive",
script: 'npm',
args: 'run start',
cwd: __dirname,
autorestart: true,
restart_delay: 4000,
kill_timeout: 5000,
instances,
exec_mode: instances > 1 ? 'cluster' : 'fork',
// 注意:不要在生产环境 watch,否则 Next.js 写入 .next 会触发重启风暴,导致 Playwright 进程被提前关闭
watch: false,
ignore_watch: ['.next', '.turbo', 'generated', 'node_modules', '.git'],
env: {
// 明确开发环境可选项(如需)
NODE_ENV: process.env.NODE_ENV || 'development',
...envFromFile,
},
env_production: {
// 关键:确保应用进程中的 NODE_ENV=production,从而禁用 Next.js 的开发特性
NODE_ENV: 'production',
// 为避免多个实例同时拉起共享浏览器,默认单实例;如需并发,请改为独立浏览器服务
WEB_CONCURRENCY: '1',
...envFromFile,
},
time: true
}
]
apps: [
{
name: "DouyinArchive",
script: "npm",
args: "run start",
cwd: __dirname,
autorestart: true,
restart_delay: 4000,
kill_timeout: 5000,
instances,
exec_mode: instances > 1 ? "cluster" : "fork",
// 注意:不要在生产环境 watch,否则 Next.js 写入 .next 会触发重启风暴,导致 Playwright 进程被提前关闭
watch: false,
ignore_watch: [".next", ".turbo", "generated", "node_modules", ".git"],
env: {
// 明确开发环境可选项(如需)
NODE_ENV: process.env.NODE_ENV || "development",
...envFromFile,
},
env_production: {
// 关键:确保应用进程中的 NODE_ENV=production,从而禁用 Next.js 的开发特性
NODE_ENV: "production",
// 为避免多个实例同时拉起共享浏览器,默认单实例;如需并发,请改为独立浏览器服务
WEB_CONCURRENCY: "1",
...envFromFile,
},
time: true,
},
],
};