From 19626fa3e7662bf8f2d6cf7c254d7391b86ffd76 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Thu, 12 Mar 2020 00:01:11 +0100 Subject: [PATCH] Only install production dependencies in Dockerfile Running npm install on a local folder will by default also install the devDependencies specified in package.json, and this is not suitable when we are building a Dockerfile for use in production. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8f8f52d4..9b00ad9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ WORKDIR /srv/configurable-http-proxy # Install configurable-http-proxy, then automatically install compatible updates # to vulnerable dependencies, and finally uninstall npm which isn't needed. -RUN npm install -g \ +RUN npm install -g --production \ && npm audit fix \ && npm uninstall -g npm