From 8bd6b30d9106e0e1d1317b0b0972a04a66088ba8 Mon Sep 17 00:00:00 2001 From: Eugene Cheah Date: Mon, 13 Jan 2020 07:42:33 +0000 Subject: [PATCH] Tweak in build process (easier api iteration) --- dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dockerfile b/dockerfile index daea2ad..dd93225 100755 --- a/dockerfile +++ b/dockerfile @@ -35,10 +35,15 @@ RUN apk add --no-cache make gcc g++ python # Build the API # with reseted node_modules FROM codebuilder AS apibuilder -# copy and reset the code +# copy and download dependencies +COPY api/package.json /application/api-mods/package.json +RUN cd /application/api-mods/ && npm install +# copy source code COPY api /application/api/ RUN rm -rf /application/api/node_modules -RUN cd /application/api && ls && npm install +# merge in dependnecies +RUN cp -r /application/api-mods/node_modules /application/api/node_modules +RUN ls /application/api/ # Build the UI # with reseted node_modules