<commit_before>FROM ubuntu:trusty
MAINTAINER ODL DevOps <<EMAIL>>


# Add package files
ADD requirements.txt /tmp/requirements.txt
ADD test_requirements.txt /tmp/test_requirements.txt
ADD doc_requirements.txt /tmp/doc_requirements.txt
ADD apt.txt /tmp/apt.txt
WORKDIR /tmp

# Install base packages
RUN apt-get update
RUN apt-get install -y $(grep -vE "^\s*#" apt.txt  | tr "\n" " ")
RUN pip install pip --upgrade

# Install project packages
RUN pip install -r requirements.txt
RUN pip install -r test_requirements.txt
RUN pip install -r doc_requirements.txt
RUN pip3 install -r requirements.txt
RUN pip3 install -r test_requirements.txt

# Add, and run as, non-root user.
RUN adduser --disabled-password --gecos "" mitodl

# Add project
ADD . /src
WORKDIR /src
RUN chown -R mitodl:mitodl /src

# Link nodejs to node since npm expects node
RUN ln -s /usr/bin/nodejs /usr/bin/node

# Install development packages globally for things like
# bower.
RUN mkdir /node
ADD package.json /node/package.json
RUN cd /node && npm install

# Install productions deps for runtime items like jsx
RUN npm install --production
ENV PATH /src/node_modules/.bin:/node/node_modules/.bin:$PATH

# Set pip cache folder, as it is breaking pip when it is on a shared volume
ENV XDG_CACHE_HOME /tmp/.cache

EXPOSE 8070

USER mitodl
CMD uwsgi uwsgi.ini<commit_msg>Added docker support for running worker or Web process by environment<commit_after>FROM ubuntu:trusty
MAINTAINER <NAME> <<EMAIL>>


# Add package files
ADD requirements.txt /tmp/requirements.txt
ADD test_requirements.txt /tmp/test_requirements.txt
ADD doc_requirements.txt /tmp/doc_requirements.txt
ADD apt.txt /tmp/apt.txt
WORKDIR /tmp

# Install base packages
RUN apt-get update
RUN apt-get install -y $(grep -vE "^\s*#" apt.txt  | tr "\n" " ")
RUN pip install pip --upgrade

# Install project packages
RUN pip install -r requirements.txt
RUN pip install -r test_requirements.txt
RUN pip install -r doc_requirements.txt
RUN pip3 install -r requirements.txt
RUN pip3 install -r test_requirements.txt

# Add, and run as, non-root user.
RUN adduser --disabled-password --gecos "" mitodl

# Add project
ADD . /src
WORKDIR /src
RUN chown -R mitodl:mitodl /src

# Link nodejs to node since npm expects node
RUN ln -s /usr/bin/nodejs /usr/bin/node

# Install development packages globally for things like
# bower.
RUN mkdir /node
ADD package.json /node/package.json
RUN cd /node && npm install

# Install productions deps for runtime items like jsx
RUN npm install --production
ENV PATH /src/node_modules/.bin:/node/node_modules/.bin:$PATH

# Set pip cache folder, as it is breaking pip when it is on a shared volume
ENV XDG_CACHE_HOME /tmp/.cache

# Gather static
RUN ./manage.py collectstatic --noinput

USER mitodl

# Set and expose port for uwsgi config
EXPOSE 8070
ENV PORT 8070
CMD if [ -n "$WORKER" ]; then celery -A lore worker; else uwsgi uwsgi.ini; fi
{'fraction_non_alphanumeric': 0.08817427385892117, 'fraction_numerical': 0.005532503457814661, 'mean_word_length': 3.9033898305084747, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, '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': '6378974', 'n_tokens_mistral': 963, 'n_tokens_neox': 918, 'n_words': 368}