From 42238dd7fcfc20f58cbc1a5a760c3a3b719cfc76 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Mon, 23 Dec 2024 12:58:45 +0800 Subject: [PATCH] Run `npmp prune` and `bundle clean` to clean up unused files 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 d5dd09526..cd333918c 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