<commit_before># Install Chanslate in a container

FROM ubuntu:14.04
MAINTAINER <NAME> "<EMAIL>"
WORKDIR /data/chanslate

# Install dependencies for installation
RUN apt-get update
RUN apt-get install -y git curl software-properties-common python-software-properties python g++ make --force-yes

# Install Node & npm
RUN add-apt-repository ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get -y install nodejs --force-yes

# Create a new user with a home folder to run the following commands
RUN useradd -m -d /home/chanslate chanslate
RUN chown    chanslate /data/chanslate 
RUN chgrp -R chanslate /data/chanslate 
RUN chmod g+s          /data/chanslate

# Now act as that user
USER chanslate
# Docker does not set the user home dir by default (#2968)
ENV HOME /home/chanslate 

# Install meteor and meteorite (only locally, sans sudo access)
RUN echo "prefix = ~/.node" >> ~/.npmrc  
RUN curl https://install.meteor.com/ | sh
RUN npm install -g meteorite meteor-npm forever

# Fetch and install the dependencies of Chanslate
RUN git clone https://github.com/musically-ut/chanslate.git chanslate-src
RUN cd /data/chanslate/chanslate-src  && ~/.node/bin/mrt install

# Bundle the app and prepare for launch
RUN mkdir -p /data/chanslate/dist/
RUN cd /data/chanslate/chanslate-src/ && ~/.meteor/meteor bundle /data/chanslate/dist/chanslate.tar.gz
RUN cd /data/chanslate/dist/          && tar xvf chanslate.tar.gz<commit_msg>Reduce the number of steps in the Dockerfile.<commit_after># Install Chanslate in a container

FROM ubuntu:14.04
MAINTAINER <NAME> "<EMAIL>"
WORKDIR /data/chanslate

# Install dependencies for installation
RUN apt-get update
RUN apt-get install -y git curl software-properties-common python-software-properties python g++ make --force-yes

# Install Node & npm
RUN add-apt-repository ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get -y install nodejs --force-yes

# Create a new user with a home folder to run the following commands
RUN useradd -m -d /home/chanslate chanslate
RUN chown    chanslate /data/chanslate 
RUN chgrp -R chanslate /data/chanslate 
RUN chmod g+s          /data/chanslate

# Now act as that user
USER chanslate
# Docker does not set the user home dir by default (#2968)
ENV HOME /home/chanslate 

# Install meteor and meteorite (only locally, sans sudo access)
RUN echo "prefix = ~/.node" >> ~/.npmrc  
RUN curl https://install.meteor.com/ | sh
RUN npm install -g meteorite meteor-npm forever

# Fetch and install the dependencies of Chanslate, Bundle the app and prepare
# for launch
RUN git clone https://github.com/musically-ut/chanslate.git chanslate-src 
    && cd /data/chanslate/chanslate-src  
    && ~/.node/bin/mrt install 
    && mkdir -p /data/chanslate/dist/ 
    && cd /data/chanslate/chanslate-src/ 
    && ~/.meteor/meteor bundle /data/chanslate/dist/chanslate.tar.gz
    && cd /data/chanslate/dist/ 
    && tar xvf chanslate.tar.gz
{'fraction_non_alphanumeric': 0.09796481545360469, 'fraction_numerical': 0.005519144532597447, 'mean_word_length': 3.538341158059468, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '698817', 'n_tokens_mistral': 1001, 'n_tokens_neox': 938, 'n_words': 332}