Skip to content

Commit

Permalink
fix(docker): prevent duplicate group creation in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
MountainGod2 committed Dec 9, 2024
1 parent 67d452e commit 9444667
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ ENV UID=99
ENV GID=100

# Create a group and user based on the environment variables
RUN addgroup -g "$GID" appgroup && \
RUN if ! getent group "$GID"; then \
addgroup -g "$GID" appgroup; \
else \
echo "Group with GID $GID already exists, skipping addgroup."; \
fi && \
adduser -u "$UID" -G appgroup -D appuser

# Configure environment variables for the virtual environment
Expand Down

0 comments on commit 9444667

Please sign in to comment.