<commit_before>#------------------------------------------------------------------------------
#
# This Dockerfile is meant for containerized deployment with Kubernetes.
#
#-------------------------------------------------------------------------------

FROM python:3.7-slim

RUN apt-get update && apt-get install -y \
    g++ \
    build-essential \
    curl \
    tar \
    git \
    vim \
    supervisor && \
    useradd -m -d /srv/rnacentral -s /bin/bash rnacentral

ENV RNACENTRAL_HOME=/srv/rnacentral
ENV RNACENTRAL_LOCAL=$RNACENTRAL_HOME/local
ENV SUPERVISOR_CONF_DIR=${SUPERVISOR_CONF_DIR:-"/srv/rnacentral/supervisor"}
ARG RNACENTRAL_BRANCH
ARG LOCAL_DEVELOPMENT

# Create folders. Install Infernal and node.js
RUN \
    mkdir -p $RNACENTRAL_HOME/local && \
    cd $RNACENTRAL_LOCAL && \
    curl -OL http://eddylab.org/infernal/infernal-1.1.1.tar.gz && \
    tar -xvzf infernal-1.1.1.tar.gz && \
    cd infernal-1.1.1 && \
    ./configure --prefix=$RNACENTRAL_LOCAL/infernal-1.1.1 && \
    make && \
    make install && \
    cd easel && \
    make install && \
    cd $RNACENTRAL_LOCAL && \
    rm infernal-1.1.1.tar.gz && \
    curl -sL https://deb.nodesource.com/setup_lts.x | bash - && \
    apt-get install -y nodejs

USER rnacentral

# Download RNAcentral, install requirements and node.js dependencies
RUN \
    cd $RNACENTRAL_HOME && \
    BRANCH="${RNACENTRAL_BRANCH:-master}" && \
    git clone -b "$BRANCH" https://github.com/RNAcentral/rnacentral-webcode.git && \
    pip3 install -r $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/requirements.txt && \
    cd $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/portal/static && npm install --only=production && \
    mkdir $RNACENTRAL_HOME/static

# Install packages for local development if needed
RUN \
    LOCAL_DEV="${LOCAL_DEVELOPMENT:-false}" && \
    if [ "$LOCAL_DEV" = "True" ] ; then \
    pip3 install -r $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/requirements_dev.txt \
    fi

WORKDIR $RNACENTRAL_HOME/rnacentral-webcode
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]

CMD [ "/bin/sh", "-c", "/usr/bin/supervisord -c ${SUPERVISOR_CONF_DIR}/supervisord.conf" ]
<commit_msg>Bug fix<commit_after>#------------------------------------------------------------------------------
#
# This Dockerfile is meant for containerized deployment with Kubernetes.
#
#-------------------------------------------------------------------------------

FROM python:3.7-slim

RUN apt-get update && apt-get install -y \
    g++ \
    build-essential \
    curl \
    tar \
    git \
    vim \
    supervisor && \
    useradd -m -d /srv/rnacentral -s /bin/bash rnacentral

ENV RNACENTRAL_HOME=/srv/rnacentral
ENV RNACENTRAL_LOCAL=$RNACENTRAL_HOME/local
ENV SUPERVISOR_CONF_DIR=${SUPERVISOR_CONF_DIR:-"/srv/rnacentral/supervisor"}
ARG RNACENTRAL_BRANCH
ARG LOCAL_DEVELOPMENT

# Create folders. Install Infernal and node.js
RUN \
    mkdir -p $RNACENTRAL_HOME/local && \
    cd $RNACENTRAL_LOCAL && \
    curl -OL http://eddylab.org/infernal/infernal-1.1.1.tar.gz && \
    tar -xvzf infernal-1.1.1.tar.gz && \
    cd infernal-1.1.1 && \
    ./configure --prefix=$RNACENTRAL_LOCAL/infernal-1.1.1 && \
    make && \
    make install && \
    cd easel && \
    make install && \
    cd $RNACENTRAL_LOCAL && \
    rm infernal-1.1.1.tar.gz && \
    curl -sL https://deb.nodesource.com/setup_lts.x | bash - && \
    apt-get install -y nodejs

USER rnacentral

# Download RNAcentral, install requirements and node.js dependencies
RUN \
    cd $RNACENTRAL_HOME && \
    BRANCH="${RNACENTRAL_BRANCH:-master}" && \
    git clone -b "$BRANCH" https://github.com/RNAcentral/rnacentral-webcode.git && \
    pip3 install -r $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/requirements.txt && \
    cd $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/portal/static && npm install --only=production && \
    mkdir $RNACENTRAL_HOME/static

# Install packages for local development if needed
RUN \
    LOCAL_DEV="${LOCAL_DEVELOPMENT:-false}" && \
    if [ "$LOCAL_DEV" = "True" ] ; then \
    pip3 install -r $RNACENTRAL_HOME/rnacentral-webcode/rnacentral/requirements_dev.txt ; \
    fi

WORKDIR $RNACENTRAL_HOME/rnacentral-webcode
COPY ./entrypoint.sh /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]

CMD [ "/bin/sh", "-c", "/usr/bin/supervisord -c ${SUPERVISOR_CONF_DIR}/supervisord.conf" ]

{'fraction_non_alphanumeric': 0.1996783088235294, 'fraction_numerical': 0.008731617647058824, 'mean_word_length': 2.305239179954442, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '161451', 'n_tokens_mistral': 1612, 'n_tokens_neox': 1532, 'n_words': 287}