feat(docker): run as non root user (#1380)
parent
745e57fbe1
commit
331f517d75
10
Dockerfile
10
Dockerfile
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue