From 14f75eabb6fb74a52dfb1d4e64b3a6666cbb7ed4 Mon Sep 17 00:00:00 2001 From: "sipc.ink" <92251518+SIPC@users.noreply.github.com> Date: Sun, 10 Mar 2024 11:59:54 +0800 Subject: [PATCH] Update Dockerfile --- Dockerfile | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index fd2ff16..5cb1e08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,10 @@ -# 构建阶段 -FROM node:18-alpine AS builder - -WORKDIR /app - -COPY package*.json ./ -RUN npm ci - -COPY . . -RUN npm run build - -# 生产阶段 FROM node:18-alpine WORKDIR /app -COPY --from=builder /app/.next /app/.next -COPY --from=builder /app/node_modules /app/node_modules - -ENV NODE_ENV=production +COPY . . +RUN npm install && npm run build EXPOSE 3000 -CMD ["next", "start"] \ No newline at end of file +CMD [ "npm", "run", "start" ]