Skip to content

Commit

Permalink
sonarcloud: fixed frontend development image to use non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-naxa committed Mar 12, 2024
1 parent 24b593e commit 20f6563
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/docker/Dockerfile.frontend_development
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
FROM node:16

# Create a non-root user
RUN groupadd -r app && useradd -r -g app -m -d /usr/src/app app

WORKDIR /usr/src/app

COPY ./frontend .

## SETUP
RUN npm install

# Change ownership of the working directory to the newly created user
RUN chown -R app:app /usr/src/app

# Switch to the non-root user
USER app

# SERVE
CMD ["npm", "start"]

0 comments on commit 20f6563

Please sign in to comment.