dockerfile update
This commit is contained in:
parent
534cefc973
commit
fe3d5ebf8d
1 changed files with 8 additions and 5 deletions
13
Dockerfile
13
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`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue