From d864231db1e5767db30b2225566fd26958a77fdb Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 22 Jul 2021 17:21:55 -0600 Subject: [PATCH] refactor(dockerfile): cleanup permissions - set proper permissions for server script and entrypoint --- build/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 9a330c8..837dbe7 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -42,17 +42,20 @@ ENV LR_EXTS="html,xml,css,js,jsx,ts,tsx,php,py" ENV LR_EXCLUDE=".git/,.svn/,.vscode/,.idea/" ENV LR_DELAY=500 -# install livereload npm and copy server script +# copy scripts, cleanup permissions and install livereload npm +COPY [ "livereload.js", "/home/node/livereload.js" ] +COPY [ "entrypoint.sh", "/usr/local/bin/entrypoint.sh" ] +RUN chown node:node /home/node/livereload.js \ + chmod 644 /home/node/livereload.js \ + chmod 755 /usr/local/bin/entrypoint.sh USER node WORKDIR /home/node RUN mkdir -p .npm-global/bin .npm-global/lib \ && npm config set fund false \ && npm config set update-notifier false \ && npm install livereload --save -COPY [ "livereload.js", "livereload.js" ] -COPY [ "entrypoint.sh", "/usr/local/bin/entrypoint.sh" ] -# run server via tini by default +# run entrypoint script by default ENTRYPOINT [ "/sbin/tini", "--", "/usr/local/bin/entrypoint.sh" ] # set build timestamp and version labels