Skip to content

Commit

Permalink
chore(Dockerfile): Ensure non-root user 'deno' exists before adding
Browse files Browse the repository at this point in the history
  • Loading branch information
csulit committed Oct 14, 2024
1 parent 51c8c13 commit 21beb18
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ WORKDIR /app

COPY --from=builder /app/server /app/server

# Create a non-root user
RUN addgroup --system deno && adduser --system --ingroup deno deno
# Create a non-root user if it doesn't exist
RUN if ! getent group deno > /dev/null 2>&1; then \
addgroup --system deno; \
fi && \
if ! getent passwd deno > /dev/null 2>&1; then \
adduser --system --ingroup deno deno; \
fi

# Set environment variables
ENV DENO_DIR=/deno-dir
Expand Down

0 comments on commit 21beb18

Please sign in to comment.