From 278f37da105a96b3c2649cc3791836aaaa1b259a Mon Sep 17 00:00:00 2001 From: Nick Alteen Date: Fri, 5 Dec 2025 11:29:04 -0500 Subject: [PATCH] Add non-root user --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index e81584f..23c4ae4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,5 +7,12 @@ WORKDIR /usr/src # Copy any source file(s) required for the action. COPY entrypoint.sh . +# Create a non-root user and switch to it. +RUN addgroup -S actiongroup && adduser -S actionuser -G actiongroup && \ + chown -R actionuser:actiongroup /usr/src && \ + chmod +x /usr/src/entrypoint.sh + +USER actionuser + # Configure the container to be run as an executable. ENTRYPOINT ["/usr/src/entrypoint.sh"]