Skip to content

Commit

Permalink
feat(docker): run as non root user (#1380)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilweth authored Jan 22, 2023
1 parent 745e57f commit 331f517
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ RUN pnpm build

FROM base AS runner

ARG UID=911
ARG GID=911

# Create a dedicated user and group
RUN set -eux; \
addgroup -g $UID elk; \
adduser -u $GID -D -G elk elk;

USER elk

ENV NODE_ENV=production

COPY --from=builder /elk/.output ./.output
Expand Down

0 comments on commit 331f517

Please sign in to comment.