Skip to content

Commit

Permalink
ALL-9118 - Upgrade Node, NPM and other libraries
Browse files Browse the repository at this point in the history
dockerfile sonar fix
  • Loading branch information
martintatum committed Dec 20, 2024
1 parent 2529d93 commit d10344b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM node:18.20.5-alpine3.20 AS builder

# Create app directory
# Create a non-root user and group
RUN groupadd -r appgroup && useradd -r -g appgroup appuser

# Create app directory
WORKDIR /usr/src/app

RUN apk --virtual build-dependencies add \
Expand All @@ -25,6 +27,12 @@ COPY . .

RUN yarn build

# Change ownership of the application files to the non-root user
RUN chown -R appuser:appgroup /usr/src/app

# Switch to the non-root user
USER appuser

ENTRYPOINT ["node", "/usr/src/app/dist/index.js"]

CMD ["daemon"]

0 comments on commit d10344b

Please sign in to comment.