From 75b191315cc255472fb3ad6c2733890e23b58103 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 c7d4498dfe..c5fd4ac4a5 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 && yarn build + +FROM node:16-alpine AS runtime + +WORKDIR /app + +COPY --from=build /app . + +RUN yarn link -CMD /bin/bash +CMD /bin/ash