diff --git a/Dockerfile b/Dockerfile index a5157c6220e5d9d0276fb4e884433edc4f7a2411..276b4c9af08efa01c92b94a3f7d98421eff7324a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,6 @@ rm -rf /tmp/* /var/cache/apk/* WORKDIR /opt/app -USER node - # Install app dependencies # A wildcard is used to ensure both package.json AND package-lock.json are copied # where available (npm@5+) @@ -23,7 +21,14 @@ COPY webpack*.js ./ COPY babel.config.js ./ # Bundle app source -COPY --chown=node src ./src +COPY src ./src + +# If translations are fetched from Google Sheets API, +# the 'node' user needs to be able to write into this folder +RUN chown -R node:node ./src/client/translations + +# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user +USER node # Run the scripts defined in package.json RUN npm install && \