build: 去除frotend docker的多阶段构建

This commit is contained in:
Titan 2026-03-16 18:46:22 +08:00
parent cb758af645
commit 590001c130
1 changed files with 1 additions and 10 deletions

View File

@ -1,5 +1,6 @@
# --------------- 构建阶段 ---------------
FROM node:22-alpine AS builder
ENV NODE_ENV=production
ARG PNPM_STORE_PATH=/root/.local/share/pnpm/store
ENV BETTER_AUTH_SECRET=any-random-string-123456
@ -13,15 +14,5 @@ RUN pnpm install --frozen-lockfile
RUN pnpm build
# --------------- 运行阶段(最小镜像) ---------------
FROM node:22-alpine AS runner
ENV NODE_ENV=production
WORKDIR /app
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
EXPOSE 3000
CMD ["pnpm", "start"]