From c19591b4aab79c1a6abeddd6f1ec951864ab0e51 Mon Sep 17 00:00:00 2001 From: infidel Date: Sat, 26 Nov 2022 10:24:38 +0700 Subject: [PATCH] node container handled as node user with node home dir --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 224fe0d..e5a024b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ FROM node:16 -WORKDIR /usr/src/app -COPY package*.json /usr/src/app/ +RUN adduser node root +WORKDIR /home/node/app +RUN chmod -R 775 /home/node/app +RUN chown -R node:root /home/node/app +COPY package*.json /home/node/app RUN npm install -COPY . /usr/src/app +COPY . /home/node/app RUN npm run build RUN npm run build:fontawesome EXPOSE 5000