<commit_before>FROM node:7
ENV NPM_CONFIG_LOGLEVEL warn

# Installing the 'apt-utils' package gets rid of the 'debconf: delaying package configuration, since apt-utils is not installed'
# error message when installing any other package with the apt-get package manager.
# https://peteris.rocks/blog/quiet-and-unattended-installation-with-apt-get/
RUN apt-get update > /dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    apt-utils \
  > /dev/null 2>&1 \
  && rm -rf /var/lib/apt/lists/*

# 1. xvfb depend on xauth
# 2. chromium(with webdriver) depend on libgconf-2-4
RUN  apt-get update > /dev/null \
  && DEBIAN_FRONTEND=noninteractive apt-get -qqy --no-install-recommends -o Dpkg::Use-Pty=0 install \
      chromium \
      figlet \
      libgconf-2-4 \
      vim \
      xauth \
      xvfb \
  > /dev/null \
  && rm -rf /tmp/* /var/lib/apt/lists/*

RUN mkdir /wechaty
WORKDIR /wechaty

COPY package.json .
RUN  npm --progress=false install > /dev/null \
  && npm --progress=false install -g yarn > /dev/null \
  && rm -fr /tmp/*
  # && npm install ts-node typescript -g \

COPY . .
RUN npm --progress false link

# Loading from node_modules Folders: https://nodejs.org/api/modules.html
# If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached.
RUN ln -s /root /bot \
  && ln -s /usr/local/lib/node_modules / \
  && ln -s /wechaty/tsconfig.json /

VOLUME [ "/bot" ]


ENTRYPOINT [ "/wechaty/bin/entrypoint.sh" ]
CMD [ "start" ]

#RUN npm test<commit_msg>symbolic link for a docker volume not support by docker of circleci?<commit_after>FROM node:7
ENV NPM_CONFIG_LOGLEVEL warn

# Installing the 'apt-utils' package gets rid of the 'debconf: delaying package configuration, since apt-utils is not installed'
# error message when installing any other package with the apt-get package manager.
# https://peteris.rocks/blog/quiet-and-unattended-installation-with-apt-get/
RUN apt-get update > /dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    apt-utils \
  > /dev/null 2>&1 \
  && rm -rf /var/lib/apt/lists/*

# 1. xvfb depend on xauth
# 2. chromium(with webdriver) depend on libgconf-2-4
RUN  apt-get update > /dev/null \
  && DEBIAN_FRONTEND=noninteractive apt-get -qqy --no-install-recommends -o Dpkg::Use-Pty=0 install \
      chromium \
      figlet \
      libgconf-2-4 \
      vim \
      xauth \
      xvfb \
  > /dev/null \
  && rm -rf /tmp/* /var/lib/apt/lists/*

RUN mkdir /wechaty
WORKDIR /wechaty

COPY package.json .
RUN  npm --progress=false install > /dev/null \
  && npm --progress=false install -g yarn > /dev/null \
  && rm -fr /tmp/*
  # && npm install ts-node typescript -g \

COPY . .
RUN npm --progress false link

# Loading from node_modules Folders: https://nodejs.org/api/modules.html
# If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached.
RUN mkdir /bot \
  && ln -s /usr/local/lib/node_modules / \
  && ln -s /wechaty/tsconfig.json /

VOLUME [ "/bot" ]


ENTRYPOINT [ "/wechaty/bin/entrypoint.sh" ]
CMD [ "start" ]

#RUN npm test
{'fraction_non_alphanumeric': 0.12786679233427584, 'fraction_numerical': 0.007540056550424128, 'mean_word_length': 2.8086124401913874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7672795', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1112, 'n_words': 340}