From 4f4f9963c78461e744cfa52206c0f8b6e3a75bc3 Mon Sep 17 00:00:00 2001 From: Singebob Date: Thu, 17 Feb 2022 15:52:07 +0100 Subject: [PATCH] :whale: add user in dockerfile --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ebb6f41c..af6f2350 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,15 @@ FROM node:16.13.2-alpine # Define some ENV Vars ENV PORT=80 \ DIRECTORY=/app \ - IS_DOCKER=true + IS_DOCKER=true \ + UID=1000 \ + GUID=1000 +# Create a group and user +RUN addgroup --gid ${GUID} application \ + && adduser --no-create-home --uid ${UID} application application + +USER application # Create and set the working directory WORKDIR ${DIRECTORY}