From 42713190b9220850a94329b2156e535af034060b Mon Sep 17 00:00:00 2001 From: Dan Leehr Date: Thu, 7 Mar 2019 16:02:51 -0500 Subject: [PATCH] Set HOME and create default user in Dockerfile Fixes #47 --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 01d6b5e..72883b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,12 @@ COPY . /app RUN pip install /app WORKDIR /app +# Create a default user and home directory +ENV HOME=/home/calrissian +RUN useradd -u 1001 -r -g 0 -m -d ${HOME} -s /sbin/nologin \ + -c "Default Calrissian User" calrissian && \ + chown -R 1001:0 /app && \ + chmod g+rwx ${HOME} + +USER calrissian CMD ["calrissian"]