Docker: Fix permission with node service by adding node as user

See: https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#non-root-user

Fixes the following error:

glob error:
[Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs'
}
This commit is contained in:
Abijeet 2021-01-27 00:20:48 +05:30
parent 7ba6962707
commit 1aa9465611

View File

@ -39,6 +39,7 @@ services:
node:
image: node:alpine
working_dir: /app
user: node
volumes:
- ./:/app
entrypoint: /app/dev/docker/entrypoint.node.sh