From 9febf3f9d207ac609cf3dc95fa41cd4dd5f308d5 Mon Sep 17 00:00:00 2001 From: elitwo <73907983+elitwo@users.noreply.github.com> Date: Tue, 22 Dec 2020 23:20:05 +0000 Subject: [PATCH] Ensure npm has access to package.json. (#31) This is a common issue, and I ran into it while installing esmBot. For me, and probably others npm throws a permissions error while building, and no packages will be installed. Simply chown the package.json to the node:node user, and this will work again. --- Dockerfile.bot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.bot b/Dockerfile.bot index 4718a99..f071ce8 100644 --- a/Dockerfile.bot +++ b/Dockerfile.bot @@ -47,10 +47,10 @@ COPY ./assets/caption2.ttf /home/esmBot/.font/caption2.ttf COPY ./assets/hbc.ttf /home/esmBot/.font/hbc.ttf RUN fc-cache -f -COPY ./package.json package.json -COPY ./package-lock.json package-lock.json +COPY --chown=node:node ./package.json package.json +COPY --chown=node:node ./package-lock.json package-lock.json RUN npm install COPY . . USER esmBot -ENTRYPOINT ["node", "app.js"] \ No newline at end of file +ENTRYPOINT ["node", "app.js"]