From 4f045ff59f85bd8c3bb8d5287b980e7a8eec5670 Mon Sep 17 00:00:00 2001 From: YuShifan <894402575bt@gmail.com> Date: Thu, 18 May 2023 19:44:13 +0800 Subject: [PATCH] chore(cli): reduce the docker image size --- cli/Dockerfile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/cli/Dockerfile b/cli/Dockerfile index c7d4498df..9c3726642 100644 --- a/cli/Dockerfile +++ b/cli/Dockerfile @@ -1,8 +1,21 @@ -FROM node:16-alpine +FROM node:16-alpine AS build WORKDIR /app + +COPY package.json yarn.lock ./ + +RUN yarn --frozen-lockfile + COPY . ./ -RUN yarn && yarn build && yarn link +RUN yarn build + +FROM node:16-alpine AS runtime + +WORKDIR /app + +COPY --from=build /app . + +RUN yarn link -CMD /bin/bash +CMD /bin/ash