<commit_before>FROM node:4.2

# Install prerequisites
# https://docs.docker.com/engine/articles/dockerfile_best-practices/#apt-get
# Base image should also have these already installed: gcc, git, make, python
# - `build-essential` and `make` are required by some Node modules
# - `unzip` & `wget` are required by API docs generator
RUN apt-get -qq update && apt-get -q install -y \
    build-essential \
    unzip \
    wget \
    graphicsmagick \
    imagemagick \
    openssl \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install Dump-init
# https://github.com/Yelp/dumb-init
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.0.0/dumb-init_1.0.0_amd64.deb
RUN dpkg -i dumb-init_*.deb

# Install global node modules
RUN npm install -g -y gulp --quiet
RUN npm install -g -y bower --quiet
RUN npm install -g -y faker --quiet

# Create working directory
RUN mkdir -p /trustroots
RUN mkdir -p /trustroots/public/lib
WORKDIR /trustroots

# Copies the local package.json file to the container
# and utilities docker container cache to not needing to rebuild
# and install node_modules/ everytime we build the docker, but only
# when the local package.json file changes.
ADD package.json /trustroots/package.json
ADD bower.json /trustroots/bower.json
ADD .bowerrc /trustroots/.bowerrc

# Set environment variables
ENV NODE_ENV development
ENV DB_1_PORT_27017_TCP_ADDR mongodb
ENV PORT 3000
ENV DOMAIN trustroots.dev

# Install npm+bower packages
RUN npm install --quiet
RUN bower install --quiet --config.interactive=false --allow-root

# Share local directory on the docker container
# ...therefore the previous docker "layer" thats been cached will be used if possible
ADD . /trustroots

# Expose ports
# - Nginx proxy     80
# - Nodemon server  3000
# - Node debug      5858
# - LiveReload      35729
EXPOSE 80
EXPOSE 3000
EXPOSE 5858
EXPOSE 35729
CMD ["dumb-init", "npm", "start"]
<commit_msg>Updating Dockerfile for more efficient image building<commit_after>FROM node:4.2

# Install prerequisites
# https://docs.docker.com/engine/articles/dockerfile_best-practices/#apt-get
# Base image should also have these already installed: gcc, git, make, python
# - `build-essential` and `make` are required by some Node modules
# - `unzip` & `wget` are required by API docs generator
RUN apt-get -qq update && apt-get -q install -y \
    build-essential \
    unzip \
    wget \
    graphicsmagick \
    imagemagick \
    openssl \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install Dump-init
# https://github.com/Yelp/dumb-init
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.0.0/dumb-init_1.0.0_amd64.deb
RUN dpkg -i dumb-init_*.deb

# Install global node modules
RUN npm install -g -y gulp --quiet
RUN npm install -g -y bower --quiet
RUN npm install -g -y faker --quiet
RUN npm install -g -y migrate --quiet

# Create working directory
RUN mkdir -p /trustroots
RUN mkdir -p /trustroots/public/lib
WORKDIR /trustroots

# Copies the local package.json file to the container
# and utilities docker container cache to not needing to rebuild
# and install node_modules/ everytime we build the docker, but only
# when the local package.json file changes.
# Install npm packages
ADD package.json /trustroots/package.json
RUN npm install --quiet

# Install bower packages
ADD bower.json /trustroots/bower.json
ADD .bowerrc /trustroots/.bowerrc
RUN bower install --quiet --config.interactive=false --allow-root

# Set environment variables
ENV NODE_ENV development
ENV DB_1_PORT_27017_TCP_ADDR mongodb
ENV PORT 3000
ENV DOMAIN trustroots.dev

# Share local directory on the docker container
# ...therefore the previous docker "layer" thats been cached will be used if possible
ADD . /trustroots

# Expose ports
# - Nginx proxy     80
# - Nodemon server  3000
# - Node debug      5858
# - LiveReload      35729
EXPOSE 80
EXPOSE 3000
EXPOSE 5858
EXPOSE 35729
CMD ["dumb-init", "npm", "start"]

{'fraction_non_alphanumeric': 0.09684741488020177, 'fraction_numerical': 0.025220680958385876, 'mean_word_length': 3.4561797752808987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4682429', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1242, 'n_words': 458}