From 91fa27bed82e534b85d107ff0c1840d1d2025059 Mon Sep 17 00:00:00 2001 From: Ashish Padhy <100484401+Shurtu-gal@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:22:39 +0530 Subject: [PATCH] fix: sonarcloud warnings --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9433bef26..2b057f1c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM node:18-alpine +# Create a non-root user +RUN addgroup -S myuser && adduser -S myuser -G myuser + RUN apk add --no-cache bash>5.1.16 git>2.42.0 # Installing latest released npm package @@ -7,6 +10,10 @@ RUN npm install --ignore-scripts -g @asyncapi/cli COPY entrypoint.sh /entrypoint.sh +# Make the bash file executable RUN chmod +x /entrypoint.sh +# Switch to the non-root user +USER myuser + ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file