anchor.diff:  # root application directory
   ENV KLICKER_DIR="/app"
   ENV PM_VERSION="2.8.0"
  -
  -# switch to the node user (uid 1000)
  -# non-root as provided by the base image
  -USER 1000
   
   # fix permissions for the global node directories
   # this allows installing pm2 globally as user 1000
  
positive.code: RUN set -x && yarn run build
  
  # run next in production mode
  CMD ["pm2-docker", "start", "--env production", "server.js"]
  
  # add labels
  LABEL maintainer="Roland Schlaefli <roland.schlaefli@bf.uzh.ch>"
  
negative.code:   && chown -R 1000:0 \
      $NPM_PREFIX/lib/node_modules \
      $NPM_PREFIX/bin \
      $NPM_PREFIX/share \
      /.pm2 \
    && chmod g+w /.pm2
  
  # switch to the node user (uid 1000)
  # non-root as provided by the base image
  USER 1000
  
  # install pm2 globally
  RUN set -x && npm install -g pm2@$PM_VERSION
  