Skip to content

Commit f6ef096

Browse files
committed
feat: upgrade dockerfile
1 parent 0062f5a commit f6ef096

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
FROM node:alpine as base
1+
FROM node:24-alpine AS base
22

3+
# build
4+
FROM base AS build
35
WORKDIR /usr/src/app
4-
56
COPY . .
67

78
RUN npm ci
8-
99
RUN npm run build
10+
RUN npm prune --production
1011

11-
FROM node:alpine
12-
12+
# run
13+
FROM base AS run
1314
WORKDIR /usr/src/app
1415

15-
COPY --from=base --chown=nobody:nogroup /usr/src/app/dist dist
16-
COPY --from=base --chown=nobody:nogroup /usr/src/app/node_modules node_modules
16+
COPY --from=build --chown=nobody:nogroup /usr/src/app/dist dist
17+
COPY --from=build --chown=nobody:nogroup /usr/src/app/node_modules node_modules
1718
USER nobody
1819
EXPOSE 9000
1920

0 commit comments

Comments
 (0)