diff --git a/Dockerfile b/Dockerfile index 28d8586a48..80dce7cfb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,20 @@ FROM node:lts -RUN mkdir -p /usr/src/app +RUN mkdir -p /usr/src/app && \ + chown -R node:node /usr/src/app WORKDIR /usr/src/app ARG NODE_ENV ENV NODE_ENV $NODE_ENV -COPY install/package.json /usr/src/app/package.json +COPY --chown=node:node install/package.json /usr/src/app/package.json + +USER node RUN npm install --only=prod && \ npm cache clean --force - -COPY . /usr/src/app + +COPY --chown=node:node . /usr/src/app ENV NODE_ENV=production \ daemon=false \