Skip to content

Commit

Permalink
fix(docker): node user permissions (#1818)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Mar 15, 2024
1 parent caa6646 commit 8e8aac7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts --omit=dev && \
npm pkg delete commitlint devDependencies jest nodemonConfig scripts && \
npm cache clean --force && \
chown node ./node_modules/htmltidy2/bin/linux64/tidy && \
chmod 100 ./node_modules/htmltidy2/bin/linux64/tidy && \
# Remove included Windows and macOS binaries
rm -rf ./node_modules/node-poppler/src/lib/* && \
Expand All @@ -28,8 +27,8 @@ RUN npm ci --ignore-scripts --omit=dev && \

# Copy source
COPY . .
## Allow for temp folder and contents to be removed on container exit
RUN chown -R node ./dist/
# Change ownership of all files and directories
RUN chown -R node:node .

# Node images provide 'node' unprivileged user to run apps and prevent
# privilege escalation attacks
Expand Down

0 comments on commit 8e8aac7

Please sign in to comment.