Add appuser to Dockerfile 97/15697/3
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 26 Jan 2026 14:56:42 +0000 (15:56 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 26 Jan 2026 15:05:50 +0000 (16:05 +0100)
Change-Id: I5916fec778f41ab20af355482104335e450f35a8
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
Dockerfile

index af9296a..c597f45 100644 (file)
@@ -57,3 +57,13 @@ RUN curl https://get.datree.io | /bin/bash
 
 RUN helm plugin install https://github.com/datreeio/helm-datree
 
+# Creating the user for the app
+RUN groupadd -g 1000 appuser && \
+    useradd -u 1000 -g 1000 -d /app appuser && \
+    mkdir /app && \
+    chown -R appuser:appuser /app
+
+WORKDIR /app
+
+# Changing the security context
+USER appuser:appuser