feat: unsupport edgeless
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user