feat: unsupport edgeless

This commit is contained in:
shinya
2025-08-18 23:04:27 +08:00
parent ed3c4239dc
commit 4df244d3a3
28 changed files with 27 additions and 32 deletions

View File

@@ -23,14 +23,8 @@ COPY --from=deps /app/node_modules ./node_modules
COPY . .
# 在构建阶段也显式设置 DOCKER_ENV
# 确保 Next.js 在编译时即选择 Node Runtime 而不是 Edge Runtime
RUN find ./src -type f -name "route.ts" -print0 \
| xargs -0 sed -i "s/export const runtime = 'edge';/export const runtime = 'nodejs';/g"
ENV DOCKER_ENV=true
# For Docker builds, force dynamic rendering to read runtime environment variables.
RUN sed -i "/const inter = Inter({ subsets: \['latin'] });/a export const dynamic = 'force-dynamic';" src/app/layout.tsx
# 生成生产构建
RUN pnpm run build