Containers should not run as root by default
Issue-ID: AAI-2822
Change-Id: I28d5426805bbf5d60aa0cd0bc1701165f233d6a9
Signed-off-by: wr148d <wr148d@att.com>
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
index 03917f7..369d1b5 100644
--- a/src/main/docker/Dockerfile
+++ b/src/main/docker/Dockerfile
@@ -3,9 +3,18 @@
ARG MICRO_HOME=/opt/app/babel
# Build up the deployment folder structure
-RUN mkdir -p $MICRO_HOME
+RUN mkdir -p $MICRO_HOME $MICRO_HOME/logs
+
+RUN groupadd aaiadmin -g 1000
+RUN adduser -u 1000 -h /opt/aaihome/aaiadmin -S -D -G aaiadmin -s /bin/bash aaiadmin
WORKDIR $MICRO_HOME
-COPY /maven/babel/ .
+
+RUN chown -R aaiadmin:aaiadmin $MICRO_HOME $MICRO_HOME/logs
+
+COPY --chown=aaiadmin:aaiadmin /maven/babel/ .
+
+USER aaiadmin
+
RUN chmod 755 bin/* \
&& ln -s /logs $MICRO_HOME/logs