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

This commit is contained in:
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

View file

@ -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