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.
This commit is contained in:
elitwo 2020-12-22 23:20:05 +00:00 committed by GitHub
parent 9b4861ae4a
commit 9febf3f9d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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"]
ENTRYPOINT ["node", "app.js"]