perf(dockerfile): moved copy file order

- moved node file copy order, allow for package.json usage
- invocation js moved after node install, faster builds
This commit is contained in:
Asif Bacchus 2021-07-30 17:07:46 -06:00
parent 106fe86cb9
commit 5994f3b82e

View File

@ -56,11 +56,12 @@ ENV CERT_HOSTNAME=""
# install node-livereload and express as node user then switch back to root user # install node-livereload and express as node user then switch back to root user
USER node USER node
WORKDIR /home/node WORKDIR /home/node
COPY --chown=node:node [ "package.json", "package-lock.json", "ab-livereload.js", "/home/node/"] COPY --chown=node:node [ "package.json", "package-lock.json", "/home/node/" ]
RUN mkdir -p .npm-global/bin .npm-global/lib \ RUN mkdir -p .npm-global/bin .npm-global/lib \
&& npm config set fund false \ && npm config set fund false \
&& npm config set update-notifier false \ && npm config set update-notifier false \
&& npm install --save && npm install --save
COPY --chown=node:node [ "ab-livereload.js", "/home/node/"]
# copy scripts and fix-up all permissions # copy scripts and fix-up all permissions
USER root USER root