build: 去除frotend docker的多阶段构建
This commit is contained in:
parent
cb758af645
commit
590001c130
|
|
@ -1,5 +1,6 @@
|
||||||
# --------------- 构建阶段 ---------------
|
# --------------- 构建阶段 ---------------
|
||||||
FROM node:22-alpine AS builder
|
FROM node:22-alpine AS builder
|
||||||
|
ENV NODE_ENV=production
|
||||||
ARG PNPM_STORE_PATH=/root/.local/share/pnpm/store
|
ARG PNPM_STORE_PATH=/root/.local/share/pnpm/store
|
||||||
ENV BETTER_AUTH_SECRET=any-random-string-123456
|
ENV BETTER_AUTH_SECRET=any-random-string-123456
|
||||||
|
|
||||||
|
|
@ -13,15 +14,5 @@ RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
RUN pnpm build
|
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
|
EXPOSE 3000
|
||||||
CMD ["pnpm", "start"]
|
CMD ["pnpm", "start"]
|
||||||
Loading…
Reference in New Issue