Skip to content

Commit 2498006

Browse files
committed
Made the docker image execute rootless
1 parent ccd0212 commit 2498006

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ WORKDIR /usr/src/app
1717
# COPY --from=deps /app/node_modules/ ./node_modules/
1818
COPY --from=build /app/package.json .
1919
COPY --from=build /app/build/ ./
20+
RUN chown -R node:node ./
21+
USER node
2022
ENTRYPOINT [ "node", "app.js" ]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Defined in [launch.json](./.vscode/launch.json)
122122

123123
### Docker
124124
Defined in [Dockerfile](./Dockerfile)
125+
The image is built to run rootless. Refer to: https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#non-root-user.
125126

126127
```
127128
npm i

0 commit comments

Comments
 (0)