From 1ae3af4a0cd59d09f699b7d44f6480c4f645041f Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Wed, 24 Nov 2021 07:24:15 +0200 Subject: [PATCH] Run as bored user within container (#140) Signed-off-by: Jari Kolehmainen --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2e3663e..0026f38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,12 +11,14 @@ RUN apk add --update python3 gcc g++ make && \ FROM node:14-alpine -RUN mkdir /app +RUN mkdir /app \ + && addgroup -S bored && adduser -S bored -G bored WORKDIR /app COPY package.json yarn.lock ./ COPY --from=build /app/node_modules /app/node_modules COPY --from=build /app/dist /app/dist +USER bored ENTRYPOINT [ "/usr/local/bin/node" ] CMD ["/app/dist/index.js"]