From 29247c08d43ce25abf038753dd572617f8ce0ddb Mon Sep 17 00:00:00 2001 From: Michael Kipnis <104723582+michaelk-kipnis@users.noreply.github.com> Date: Mon, 18 Jul 2022 12:34:05 +0300 Subject: [PATCH] security/add-user-to-dockerfile --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 613f284..401c0b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ RUN pip install -r ${APP_DIR}/requirements.txt # copy app files COPY . ./ - +RUN useradd -ms /bin/bash anecdotes +RUN chown -R anecdotes:anecdotes /app +USER anecdotes # command to run in container start -CMD python ${APP_DIR}/main.py \ No newline at end of file +CMD python ${APP_DIR}/main.py