From 2fb389f61dc1fb88f0fb2db991da7f1a290b3afa Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Mon, 23 Dec 2024 16:38:59 +0800 Subject: [PATCH] Run `npmp prune` and `bundle clean` to clean up unused files (#902) pnpm packages and bundle gems can add significant size to the Docker image. Ensure that we clean up those unused files to ensure we don't add extra diskspace to the final layer when bootstrapping. --- templates/web.template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/web.template.yml b/templates/web.template.yml index d5dd095..cd33391 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -188,7 +188,7 @@ run: fi su discourse -c 'yarn install --frozen-lockfile && yarn cache clean' else - su discourse -c 'CI=1 pnpm install --frozen-lockfile' + su discourse -c 'CI=1 pnpm install --frozen-lockfile && pnpm prune' fi - exec: @@ -196,6 +196,7 @@ run: hook: bundle_exec cmd: - su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3' + - su discourse -c 'bundle clean' - exec: cd: $home -- 2.25.1