anchor.diff:  USER $USER_NAME
   
   # Perform actions.
  -RUN echo $NPM_REGISTRY_URL
  -RUN bash docker-npmrc.sh $NPM_REGISTRY_URL
  -RUN npm install
  -RUN npm run build
  +RUN echo $NPM_REGISTRY && \
  +    bash build/docker-npmrc.sh $NPM_REGISTRY && \
  +    npm install && \
  +    npm run build
   
   # Nginx stage.
   FROM nginx:alpine
  
positive.code: # Settings.
  ARG USER_ID=3001
  ARG USER_NAME=status
  ARG HOME_DIR=/$USER_NAME
  ARG SOURCE_DIR=$HOME_DIR/source
  ARG NPM_REGISTRY_URL=upstream
  ARG NODE_ENV=development
  
  # Node stage.
  FROM node:lts-slim as build
  ARG USER_ID
  ARG USER_NAME
  ARG HOME_DIR
  ARG SOURCE_DIR
  ARG NPM_REGISTRY_URL
  ARG NODE_ENV
  
  ENV NODE_ENV=$NODE_ENV
  
  # Create the group (use a high ID to attempt to avoid conflits).
  RUN groupadd --non-unique -g $USER_ID $USER_NAME
  
  # Create the user (use a high ID to attempt to avoid conflits).
  RUN useradd --non-unique -d $HOME_DIR -m -u $USER_ID -g $USER_ID $USER_NAME
  
  # Update the system.
  RUN apt-get update && apt-get upgrade -y
  
  # Ensure "ip" is available.
  RUN apt install iproute2 -y
  
  # Copy files over.
  COPY . $SOURCE_DIR
  
  # Copy NPM registry helper script.
  COPY build/docker-npmrc.sh $SOURCE_DIR/docker-npmrc.sh
  
  # Assign file permissions.
  RUN chown -R ${USER_ID}:${USER_ID} ${SOURCE_DIR}
  
  # Set deployment directory.
  WORKDIR $SOURCE_DIR
  
negative.code: # Cleanup user share nginx web root.
  RUN rm -rf /usr/share/nginx/html/*
  
  # Copy in files from outside of docker.
  COPY --from=build $SOURCE_DIR/dist /usr/share/nginx/html
  COPY build/appConfig.js.template /usr/local/app/templates/appConfig.js.template
  COPY build/default.conf.template /usr/local/nginx/templates/default.conf.template
  COPY build/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
  
  RUN touch /var/run/nginx.pid && \
      chown -R nginx:nginx /var/cache/nginx /var/log/nginx /etc/nginx/conf.d /var/run/nginx.pid && \
      chmod +x /usr/local/bin/docker-entrypoint.sh
  
  # Must not have a trailing slash.
  ENV BASE_PATH /status
  