From eccec0ba0aa7a87e85b6a72bf77b688678edcc53 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 2 Mar 2021 23:53:12 -0500 Subject: [PATCH] Docker: Invoke npm only once when installing plugins This speeds up the build process. --- Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e76ca5c1a..660aacf9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -72,11 +72,7 @@ COPY --chown=etherpad:etherpad ./ ./ RUN src/bin/installDeps.sh && \ rm -rf ~/.npm/_cacache -# Install the plugins, if ETHERPAD_PLUGINS is not empty. -# -# Bash trick: in the for loop ${ETHERPAD_PLUGINS} is NOT quoted, in order to be -# able to split at spaces. -RUN for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}" || exit 1; done +RUN [ -z "${ETHERPAD_PLUGINS}" ] || npm install ${ETHERPAD_PLUGINS} # Copy the configuration file. COPY --chown=etherpad:etherpad ./settings.json.docker "${EP_DIR}"/settings.json