Skip to content

Commit

Permalink
fix(docker): remove unnecessary sudo access for worker user
Browse files Browse the repository at this point in the history
- Remove sudo access configuration as it's not required
- Container already runs as non-root user (UID 500) by default
- Maintain principle of least privilege for container security
  • Loading branch information
fqjony committed Feb 11, 2025
1 parent 259bff6 commit 0118cff
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ RUN ARCH=$(uname -m) && \

# Create a new user and group with specific UID and GID, and set permissions
RUN groupadd -g ${GID} ${USER} && \
useradd -l -m -u ${UID} -g ${GID} -s /bin/bash ${USER} && \
mkdir -p /etc/sudoers.d && \
echo "${USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USER} && \
chmod 0440 /etc/sudoers.d/${USER}
useradd -l -m -u ${UID} -g ${GID} -s /bin/bash ${USER}

# Create the Supervisor log directory and set permissions
RUN mkdir -p /var/log/supervisor /var/run/supervisor && \
Expand Down

0 comments on commit 0118cff

Please sign in to comment.