{/* The content of this doc is shared between the app and pages router. You can use the
component to add content that is specific to the Pages Router. Any shared content should not be wrapped in a component. */}
Next.js 在 next build 期间生成一个 ID,以标识正在提供的是哪个版本的应用程序。同一个构建版本应该用于启动多个容器。
如果您的环境的每个阶段都需要重新构建,则需要在容器之间生成一个一致的构建 ID。请在 next.config.js 中使用 generateBuildId 命令:
module.exports = {
generateBuildId: async () => {
// This could be anything, using the latest git hash
return process.env.GIT_HASH
},
}