From fe3d5ebf8d718778bf6c8679e96cc1a9f32ad334 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 15 Jun 2025 14:02:49 -0500 Subject: [PATCH] dockerfile update --- Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 73e3226..d3f5ef7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,9 +73,9 @@ RUN apt-get update -y && \ tini && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ - # Create a non-root user and group - groupadd -r aprs && \ - useradd -r -g aprs -s /bin/false -M aprs && \ + # Create a non-root user and group with specific ID + groupadd -g 65534 aprs && \ + useradd -r -g aprs -u 65534 -s /bin/false -M aprs && \ # Remove setuid and setgid permissions find / -perm /6000 -type f -exec chmod a-s {} \; || true && \ # Secure system configurations @@ -111,9 +111,12 @@ ENV MIX_ENV="prod" \ ERL_AFLAGS="+S 1:1 +A 1 +K true -kernel shell_history enabled -kernel shell_history_file_bytes 0" # Only copy the final release from the build stage -COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/aprs ./ +COPY --from=builder --chown=aprs:aprs /app/_build/${MIX_ENV}/rel/aprs ./ -USER nobody +USER aprs + +# Ensure the server binary is executable +RUN chmod +x /app/bin/server # If using an environment that doesn't automatically reap zombie processes, it is # advised to add an init process such as tini via `apt-get install`