viewtube
viewtube copied to clipboard
Allow to run as non-root user in docker
description
I'm running viewtube using docker, i'd like to not have to run it as root to enhance security of my host system.
acceptance criterias
- [ ] the app should work when run with the user that is not uid=0
When I tried I got access errors:
/home/app/node_modules/.pnpm/[email protected]/node_modules/file-stream-rotator/FileStreamRotator.js:672
throw e;
^
Error: EACCES: permission denied, mkdir '/home/app/logs/'
at Object.mkdirSync (node:fs:1391:3)
at /home/app/node_modules/.pnpm/[email protected]/node_modules/file-stream-rotator/FileStreamRotator.js:669:24
at Array.reduce (<anonymous>)
at mkDirForFile (/home/app/node_modules/.pnpm/[email protected]/node_modules/file-stream-rotator/FileStreamRotator.js:656:27)
at FileStreamRotator.getStream (/home/app/node_modules/.pnpm/[email protected]/node_modules/file-stream-rotator/FileStreamRotator.js:532:5)
at new DailyRotateFile (/home/app/node_modules/.pnpm/[email protected][email protected]/node_modules/winston-daily-rotate-file/daily-rotate-file.js:81:57)
at Array.<anonymous> (/home/app/server/dist/main.cjs:3071:9)
at __webpack_require__ (/home/app/server/dist/main.cjs:18924:41)
at Array.<anonymous> (/home/app/server/dist/main.cjs:2817:78)
at __webpack_require__ (/home/app/server/dist/main.cjs:18924:41) {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/home/app/logs/'
}
Node.js v18.19.1
This is a good suggestion. I will have to do some reading on how to do it!