Skip to content

Commit

Permalink
chore: Added a fix to run the app as an unprivileged user
Browse files Browse the repository at this point in the history
  • Loading branch information
SwatiEY committed Dec 11, 2023
1 parent 7587c2e commit 242eb77
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions merkle-tree/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM node:iron-slim

ENV USERNAME="app"

RUN addgroup --gid 10001 $USERNAME && \
adduser --gid 10001 --uid 10001 --home /app $USERNAME

WORKDIR /app

COPY ./package.json ./package-lock.json ./
Expand All @@ -8,5 +13,6 @@ COPY ./test ./test
COPY ./.babelrc ./
RUN npm install

USER $USERNAME:$USERNAME
EXPOSE 80
CMD npm start

0 comments on commit 242eb77

Please sign in to comment.