anchor.diff:  USER root
   
   ENV HOME /home
  -ENV USER docker
  -ENV APP_DIR $HOME/$USER/app
  +ENV APP_DIR $HOME/docker/app
   
   # http://pkg-shadow.alioth.debian.org/features.php
   ENV TEMPORARY_DEPENDENCIES='shadow'
   RUN apk update && apk --no-cache add ${TEMPORARY_DEPENDENCIES}
   # add user as per: https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#user
  -RUN groupadd -r $USER && useradd --no-log-init -r -g $USER $USER
  -
  +RUN groupadd -r docker && useradd --no-log-init -r -g docker docker
  +RUN chown -R docker $HOME
   
   ###
   # nodejs installation
  
positive.code: # create dedicated directory
  RUN mkdir -p $APP_DIR
  RUN mkdir -p $APP_DIR/tests_output/screenshots
  ADD scripts/entrypoint.sh /entrypoint.sh
  RUN chmod 755 /entrypoint.sh
  
  # copy package.json to image
  ADD package.json $APP_DIR
  # change rights of the folder containing the newly copied content
  RUN chown -R $USER $HOME
  # switch to docker user to ensure correct permissions for npm dependencies
  USER $USER
  
  WORKDIR $APP_DIR
  
  
negative.code: # add rest of repo to image (doing this after installing npm dependencies
  # makes for a faster development workflow because only a change to package.json
  # will force docker to rebuild the "npm install" layer above)
  COPY --chown=docker:docker . $APP_HOME
  
  ENTRYPOINT ["/entrypoint.sh"]
  