forked from Mirrors/elk
feat(docker): run as non root user (#1380)
This commit is contained in:
parent
745e57fbe1
commit
331f517d75
1 changed files with 10 additions and 0 deletions
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 a new issue