Improvement to Dockerfile to aovis warning messages due to 'root' user
Change-Id: Icdaa33f3e22388d4877fee669160d287d7fd00e3
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 5641eee..39e3e97 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -4,10 +4,15 @@
# SPDX-License-Identifier: Apache-2.0
#
FROM python:3.6-slim-buster
-WORKDIR /app
-COPY requirements.txt requirements.txt
-RUN pip3 install --upgrade pip
-RUN pip3 install -r requirements.txt
-COPY . .
+
+RUN useradd -ms /bin/bash ubuntu
+USER ubuntu
+WORKDIR /home/ubuntu
+
+ENV PATH="/home/ubuntu/.local/bin:${PATH}"
+RUN python3 -m pip install --upgrade pip
+COPY --chown=ubuntu:ubuntu requirements.txt requirements.txt
+RUN python3 -m pip install --user -r requirements.txt
+COPY --chown=ubuntu:ubuntu . .
EXPOSE 3333
ENTRYPOINT [ "python3", "./network-diag-app.py"]