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 a833f7e commit 60b33a9
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
FROM node:18-alpine
# 构建阶段
FROM node:18-alpine AS builder

WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY . .
RUN npm install --production && npm run build
RUN npm run build

# 生产阶段
FROM node:18-alpine

WORKDIR /app

COPY --from=builder /app/build /app/build
COPY --from=builder /app/node_modules /app/node_modules

ENV NODE_ENV=production

EXPOSE 3000

CMD [ "npm", "run", "start" ]
CMD ["npm", "start"]

0 comments on commit 60b33a9

Please sign in to comment.