From 0fbd20aa7efab51412e0619af82c3dbc62e634a3 Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Thu, 15 Sep 2022 16:35:34 +0100 Subject: [PATCH] Update Dockerfile Signed-off-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- packages/backend/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/backend/Dockerfile b/packages/backend/Dockerfile index 7ed0121467..21ff07deb4 100644 --- a/packages/backend/Dockerfile +++ b/packages/backend/Dockerfile @@ -19,15 +19,17 @@ RUN apt-get update && \ yarn config set python /usr/bin/python3 # From here on we use the least-privileged `node` user to run the backend. -USER node WORKDIR /app +RUN chown node:node /app +USER node + # This switches many Node.js dependencies to production mode. ENV NODE_ENV production # Copy over Yarn 3 configuration, release, and plugins -COPY .yarn ./.yarn -COPY .yarnrc.yml ./ +COPY --chown=node:node .yarn ./.yarn +COPY --chown=node:node .yarnrc.yml ./ # Copy repo skeleton first, to avoid unnecessary docker cache invalidation. # The skeleton contains the package.json of each package in the monorepo,