删除不再使用的 Docker 相关文件,包括 Dockerfile、docker-compose.yml 和 .dockerignore,简化项目结构以提升可维护性。同时,更新 DEPLOYMENT.md 文档,调整 Next.js 配置说明,确保与新部署方式一致。

This commit is contained in:
乘风
2026-02-05 16:58:01 +08:00
parent d83f3d8419
commit 19d0e625db
35 changed files with 368 additions and 5146 deletions

View File

@@ -46,7 +46,8 @@ function copyDir(src, dst) {
}
}
console.log('🚀 准备启动 Standalone 服务器...\n');
console.log('🚀 准备启动 Standalone 服务器...');
console.log(' (请勿在 .next/standalone 下直接 node server.js否则会 404须在项目根用 pnpm start\n');
// 检查 standalone 目录
if (!fs.existsSync(standaloneDir)) {
@@ -73,10 +74,18 @@ if (!fs.existsSync(chunksDir)) {
console.log(' public → .next/standalone/public');
copyDir(publicSrc, publicDst);
// 同步构建索引BUILD_ID、build-manifest 等,避免服务器用错版本导致 404
// 同步构建索引(与 devlop 打包一致),避免本地/宝塔 server 用错导致页面空白 404
const nextRoot = path.join(rootDir, '.next');
const nextStandalone = path.join(standaloneDir, '.next');
const indexFiles = ['BUILD_ID', 'build-manifest.json', 'app-path-routes-manifest.json', 'routes-manifest.json'];
const indexFiles = [
'BUILD_ID',
'build-manifest.json',
'app-path-routes-manifest.json',
'routes-manifest.json',
'prerender-manifest.json',
'required-server-files.json',
'fallback-build-manifest.json',
];
for (const name of indexFiles) {
const src = path.join(nextRoot, name);
const dst = path.join(nextStandalone, name);