3c766a4967
- next.config.ts 开启 output: standalone, 构建产物 .next/standalone 自带 精简 node_modules 与 server.js(替换原 Nuxt .output 形态) - Dockerfile: 两阶段构建(DaoCloud node:22-slim + pnpm npmmirror), 运行时仅拷 standalone 产物 + static + public, 非 root 用户, ENV HOSTNAME=0.0.0.0 PORT=3000, CMD node server.js - .dockerignore: 排除 node_modules/.next/haoqi_clone/.workbuddy 等, 控制构建上下文体积
12 lines
414 B
TypeScript
12 lines
414 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
// Docker 部署:构建产物自带精简 node_modules,运行 `node server.js` 即可
|
|
// (产物 .next/standalone + .next/static,见 Dockerfile)
|
|
output: "standalone",
|
|
// Next 16 blocks dev resources from "cross-origin" hosts like 127.0.0.1 by default.
|
|
allowedDevOrigins: ["127.0.0.1", "localhost"],
|
|
};
|
|
|
|
export default nextConfig;
|