Skip to content

Commit 59678a5

Browse files
committed
perf: admin/Dockerfile 挂载包管理器缓存目录
1 parent 276f1e1 commit 59678a5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
FROM node:16-alpine as DIST
1+
FROM node:16-alpine as build-stage
22

33
WORKDIR /admim
44

5-
COPY ./package.json .
6-
COPY ./yarn.lock .
7-
COPY ./.npmrc .
8-
RUN yarn install
5+
COPY .npmrc package.json yarn.lock ./
6+
RUN --mount=type=cache,id=yarn-store,target=/root/.yarn-store \
7+
yarn install
98

109
COPY . .
1110
ARG NODE_ENV=""
@@ -17,6 +16,6 @@ FROM nginx:alpine
1716
ENV TZ=Asia/Shanghai
1817

1918
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
20-
COPY --from=DIST /admim/dist /usr/share/nginx/html
19+
COPY --from=build-stage /admim/dist /usr/share/nginx/html
2120

2221
EXPOSE 80

0 commit comments

Comments
 (0)