From 166bf4fa98158f2220247f036fbc946164eb2d47 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Ducati?= <ducati@cl.uni-heidelberg.de>
Date: Thu, 26 Sep 2024 17:41:41 +0000
Subject: [PATCH] changed docker image so it runs as non root user

---
 Dockerfile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index c8b70c6..bee6517 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -5,8 +5,7 @@ WORKDIR /app
 EXPOSE 5000
 
 # First, copy and install only the requirements...
-RUN useradd -ms /bin/bash python
-USER python
+RUN useradd -ms /bin/bash python && chown -R python:python /app
 RUN pip install --upgrade pip setuptools
 RUN pip install pipenv
 COPY Pipfile.lock .
@@ -15,7 +14,7 @@ RUN pip uninstall --yes pipenv
 RUN pip install -r requirements.txt
 # ... then the rest of the application. This allows the installation stage to be cached most of the time
 # (so we don't have reinstall of all dependencies every time the container is rebuilt)
-COPY . .
+COPY --chown=python:python . .
 
 FROM base AS dev
 ENV SERVER_TYPE=flask
-- 
GitLab