feat(docker): run as non root user (#1380)

zio/stable
emilweth 2023-01-22 08:18:50 +01:00 committed by GitHub
parent 745e57fbe1
commit 331f517d75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,16 @@ RUN pnpm build
FROM base AS runner 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 ENV NODE_ENV=production
COPY --from=builder /elk/.output ./.output COPY --from=builder /elk/.output ./.output