File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ COPY --from=deps /app/node_modules ./node_modules
1919COPY . .
2020
2121# 禁用 Next.js 遥测
22- ENV NEXT_TELEMETRY_DISABLED 1
22+ ENV NEXT_TELEMETRY_DISABLED= 1
2323
2424# 构建应用
2525RUN npm run build
@@ -28,24 +28,25 @@ RUN npm run build
2828FROM base AS runner
2929WORKDIR /app
3030
31- ENV NODE_ENV production
32- ENV NEXT_TELEMETRY_DISABLED 1
31+ ENV NODE_ENV= production
32+ ENV NEXT_TELEMETRY_DISABLED= 1
3333
3434# 创建非 root 用户
3535RUN addgroup --system --gid 1001 nodejs
3636RUN adduser --system --uid 1001 nextjs
3737
3838# 复制构建产物
39- COPY --from=builder /app/public ./public
40-
4139# 自动利用 standalone 输出以减小镜像体积
4240COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
4341COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
4442
43+ # 如果有 public 目录,取消注释下一行
44+ # COPY --from=builder /app/public ./public
45+
4546USER nextjs
4647
4748# 暴露端口(默认 8367)
48- ENV PORT 8367
49+ ENV PORT= 8367
4950EXPOSE 8367
5051
5152# 启动命令
You can’t perform that action at this time.
0 commit comments