Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
SIPC committed Mar 10, 2024
1 parent 392a24f commit 14f75ea
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
CMD [ "npm", "run", "start" ]

0 comments on commit 14f75ea

Please sign in to comment.