From cfe820933b0d4de2d372e5dc74aa02c0af40c0ad Mon Sep 17 00:00:00 2001 From: Alex Belanger Date: Mon, 11 Mar 2024 19:04:02 -0400 Subject: [PATCH] Non-root user. --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 928c0943..264374e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,12 @@ RUN cd /opt/pbot && cpanm -n --installdeps . --with-all-features --without-featu # Mount point to persist the bot's data. RUN mkdir /mnt/persistent +# Prefer a non-root user to run the bot. +RUN useradd -ms /bin/bash pbot +USER pbot + # Just in case files are created in the working directory. -WORKDIR /tmp +WORKDIR /home/pbot # Executable. -ENTRYPOINT /opt/pbot/bin/pbot +ENTRYPOINT /opt/pbot/bin/pbot \ No newline at end of file