<commit_before>FROM ubuntu:14.04

# There are config files EVERYWHERE. All of the proceeding work with vars is an attempt to tame that by
# creating a single source-vars.sh file where ALL configs can be found and changed. This greatly
# complicates the build process, but makes life easier of anyone having to administer/import this image

### Variables ##################################################################################################
ENV TERM="xterm"
ENV GRITS_HOME="/home/grits"
ENV MONGO_URL="mongodb://CHANGEME:27017"
ENV METEOR_DB_NAME="diagnosis"
ENV PORT="3001"
ENV ROOT_URL="http://CHANGEME"
ENV MAIL_URL="smtp://localhost"
ENV GRID_URL="https://eidr.ecohealthalliance.org"
ENV NLTK_DATA="$GRITS_HOME/nltk_data"
ENV ANNOTATOR_DB_PATH="/shared/.annotator.sqlitedb"
ENV BASIC_AUTH="CHANGEME"
ENV GEONAME_LOOKUP_URL="http://geoname-lookup.eha.io"

#Environment variables do not get exported to all subshells.
#Have to take this brute force approach
RUN touch /source-vars.sh &&\
    chmod +x /source-vars.sh &&\
    echo "export GRITS_HOME=$GRITS_HOME" >> /source-vars.sh &&\
    echo "export MONGO_URL=$MONGO_URL" >> /source-vars.sh &&\
    echo "export METEOR_DB_NAME=$METEOR_DB_NAME" >> /source-vars.sh &&\
    echo "export PORT=$PORT" >> /source-vars.sh &&\
    echo "export ROOT_URL=$ROOT_URL" >> /source-vars.sh &&\
    echo "export MAIL_URL=$MAIL_URL" >> /source-vars.sh &&\
    echo "export GRID_URL=$GRID_URL" >> /source-vars.sh &&\
    echo "export NLTK_DATA=$NLTK_DATA" >> /source-vars.sh &&\
    echo "export BASIC_AUTH=$BASIC_AUTH" >> /source-vars.sh &&\
    echo "export AWS_ACCESS_KEY_ID=CHANGEME" >> /source-vars.sh &&\
    echo "export AWS_SECRET_ACCESS_KEY=CHANGEME" >> /source-vars.sh &&\
    echo "export AWS_DEFAULT_REGION=us-east-1" >> /source-vars.sh &&\
    echo "export BROKER_URL=redis://CHANGEME:6379/0" >> /source-vars.sh &&\
    echo "export BING_TRANSLATE_ID=CHANGEME" >> /source-vars.sh &&\
    echo "export BING_TRANSLATE_SECRET=CHANGEME" >> /source-vars.sh &&\
    echo "export GRITS_API_KEY=CHANGEME" >> /source-vars.sh &&\
    echo "export BSVE_ENDPOINT=http://beta-search.bsvecosystem.net" >> /source-vars.sh &&\
    echo "export BSVE_USER_NAME=CHANGEME" >> /source-vars.sh &&\
    echo "export BSVE_API_KEY=CHANGEME" >> /source-vars.sh &&\
    echo "export BSVE_SECRET_KEY=CHANGEME" >> /source-vars.sh &&\
    echo "export BSVE_ACCESS_KEY=loremipsumhello714902" >> /source-vars.sh &&\
    echo "export GRITS_CURATOR_EMAIL=CHANGEME" >> /source-vars.sh &&\
    echo "export GRITS_CURATOR_PASSWORD=<PASSWORD>" >> /source-vars.sh

### Need this as a pre-setup ###################################################################################
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# Set debconf to run non-interactively
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

#Enable universe repo
RUN apt-get update && apt-get -y install lsb-release &&\
    echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe" >> /etc/apt/sources.list &&\
    apt-get update

#Enable node related PPA
RUN apt-get install -y software-properties-common &&\
    add-apt-repository ppa:chris-lea/node.js &&\<commit_msg>Add wget<commit_after>FROM ubuntu:14.04

# There are config files EVERYWHERE. All of the proceeding work with vars is an attempt to tame that by
# creating a single source-vars.sh file where ALL configs can be found and changed. This greatly
# complicates the build process, but makes life easier of anyone having to administer/import this image

### Variables ##################################################################################################
ENV TERM="xterm"
ENV GRITS_HOME="/home/grits"
ENV MONGO_URL="mongodb://CHANGEME:27017"
ENV METEOR_DB_NAME="diagnosis"
ENV PORT="3001"
ENV ROOT_URL="http://CHANGEME"
ENV MAIL_URL="smtp://localhost"
ENV GRID_URL="https://eidr.ecohealthalliance.org"
ENV NLTK_DATA="$GRITS_HOME/nltk_data"
ENV ANNOTATOR_DB_PATH="/shared/.annotator.sqlitedb"
ENV BASIC_AUTH="CHANGEME"
ENV GEONAME_LOOKUP_URL="http://geoname-lookup.eha.io"

#Environment variables do not get exported to all subshells.
#Have to take this brute force approach
RUN touch /source-vars.sh &&\
    chmod +x /source-vars.sh &&\
    echo "export GRITS_HOME=$GRITS_HOME" >> /source-vars.sh &&\
    echo "export MONGO_URL=$MONGO_URL" >> /source-vars.sh &&\
    echo "export METEOR_DB_NAME=$METEOR_DB_NAME" >> /source-vars.sh &&\
    echo "export PORT=$PORT" >> /source-vars.sh &&\
    echo "export ROOT_URL=$ROOT_URL" >> /source-vars.sh &&\
    echo "export MAIL_URL=$MAIL_URL" >> /source-vars.sh &&\
    echo "export GRID_URL=$GRID_URL" >> /source-vars.sh &&\
    echo "export NLTK_DATA=$NLTK_DATA" >> /source-vars.sh &&\
    echo "export BASIC_AUTH=$BASIC_AUTH" >> /source-vars.sh &&\
    echo "export AWS_ACCESS_KEY_ID=CHANGEME" >> /source-vars.sh &&\
    echo "export AWS_SECRET_ACCESS_KEY=CHANGEME" >> /source-vars.sh &&\
    echo "export AWS_DEFAULT_REGION=us-east-1" >> /source-vars.sh &&\
    echo "export BROKER_URL=redis://CHANGEME:6379/0" >> /source-vars.sh &&\
    echo "export BING_TRANSLATE_ID=CHANGEME" >> /source-vars.sh &&\
    echo "export BING_TRANSLATE_SECRET=CHANGEME" >> /source-vars.sh &&\
    echo "export GRITS_API_KEY=CHANGEME" >> /source-vars.sh &&\
    echo "export BSVE_ENDPOINT=http://beta-search.bsvecosystem.net" >> /source-vars.sh &&\
    echo "export BSVE_USER_NAME=CHANGEME" >> /source-vars.sh &&\
    echo "export BSVE_API_KEY=CHANGEME" >> /source-vars.sh &&\
    echo "export BSVE_SECRET_KEY=CHANGEME" >> /source-vars.sh &&\
    echo "export BSVE_ACCESS_KEY=loremipsumhello714902" >> /source-vars.sh &&\
    echo "export GRITS_CURATOR_EMAIL=CHANGEME" >> /source-vars.sh &&\
    echo "export GRITS_CURATOR_PASSWORD=<PASSWORD>" >> /source-vars.sh

### Need this as a pre-setup ###################################################################################
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

# Set debconf to run non-interactively
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

#Enable universe repo
RUN apt-get update && apt-get -y install lsb-release wget &&\
    echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe" >> /etc/apt/sources.list &&\
    apt-get update

#Enable node related PPA
RUN apt-get install -y software-properties-common &&\
    add-apt-repository ppa:chris-lea/node.js &&\
{'fraction_non_alphanumeric': 0.19123505976095617, 'fraction_numerical': 0.007661661048115232, 'mean_word_length': 4.33687653311529, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 101, 'https://': 2, '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': '1530347', 'n_tokens_mistral': 2295, 'n_tokens_neox': 2251, 'n_words': 510}