|
@@ -92,6 +92,9 @@ WORKDIR /app
|
|
|
|
|
|
ENV NODE_ENV production
|
|
|
|
|
|
+# 安装 pnpm
|
|
|
+RUN npm install -g pnpm
|
|
|
+
|
|
|
# 安装 dos2unix
|
|
|
RUN apk add --no-cache dos2unix
|
|
|
|
|
@@ -101,6 +104,7 @@ RUN adduser -S nextjs -u 1001
|
|
|
# 复制必要文件
|
|
|
COPY --from=builder /app/public ./public
|
|
|
COPY --from=builder /app/package.json ./package.json
|
|
|
+COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml
|
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
|
|
|
COPY --from=builder /app/next.config.mjs ./next.config.mjs
|
|
@@ -118,5 +122,5 @@ EXPOSE 3000
|
|
|
ENV PORT 3000
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
|
|
-# 使用 pnpm 启动应用
|
|
|
-CMD ["pnpm", "start"]
|
|
|
+# 使用 node 直接启动 Next.js
|
|
|
+CMD ["node", "node_modules/.bin/next", "start"]
|