From 20437c489964e7a4064147bae395e39cbe3f9421 Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 6 Mar 2022 09:58:45 +0100 Subject: [PATCH] Do not run the container as root --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e67c0f6..0fe06c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,14 @@ FROM python:slim WORKDIR ./ +ARG PUID=1000 +ENV USER docker +ENV HOMEDIR "/home/${USER}" -COPY requirements.txt ./ +RUN useradd -u "${PUID}" -m "${USER}" +USER ${USER} +WORKDIR ${HOMEDIR} +COPY . . RUN pip install --no-cache-dir -r requirements.txt -COPY . . - CMD [ "python", "./bot.py" ] \ No newline at end of file