<commit_before>FROM centos:7

ENV PIP_NO_CACHE_DIR off

# Install python
RUN yum -y install epel-release \
    && yum -y install python python-pip \
    && pip install virtualenv \
    && yum -y clean all \
    && rm -rf /var/cache/yum

# TODO(cutwater): Create user / group for galaxy?

# Install dumb-init or tini
ENV TINI_VERSION v0.16.1
RUN yum -y install wget \
    && wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" \
    && chmod +x /usr/local/bin/tini \
    && yum -y remove wget \
    && yum -y clean all \
    && rm -rf /var/cache/yum

# Create directories structure
RUN mkdir -p /etc/galaxy \
    && mkdir -p /var/log/galaxy \
    && mkdir -p /var/lib/galaxy/public

# Install python dependencies
ENV VENV_BIN /var/lib/galaxy/venv/bin
COPY requirements.txt /tmp/requirements.txt
RUN virtualenv /var/lib/galaxy/venv \
    && ${VENV_BIN}/pip install -U pip \
    && ${VENV_BIN}/pip install -r /tmp/requirements.txt

# Copy sources
# TODO(cutwater): Install galaxy as a wheel package using pip
COPY scripts/docker-release/entrypoint.sh /entrypoint.sh
COPY . /galaxy
RUN mv /galaxy/build/static /var/lib/galaxy/public/static

WORKDIR /galaxy

ENV DJANGO_SETTINGS_MODULE galaxy.settings.production

EXPOSE 8000

ENTRYPOINT ["/entrypoint.sh"]
CMD ["run", "web"]<commit_msg>Use a user `galaxy` to run application in release container<commit_after>FROM centos:7

RUN useradd -r -m -g root galaxy

ENV PIP_NO_CACHE_DIR off

# Install python
RUN yum -y install epel-release \
    && yum -y install python python-pip \
    && pip install virtualenv \
    && yum -y clean all \
    && rm -rf /var/cache/yum

# Install tini
ENV TINI_VERSION v0.16.1
RUN yum -y install wget \
    && wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini" \
    && chmod +x /usr/local/bin/tini \
    && yum -y remove wget \
    && yum -y clean all \
    && rm -rf /var/cache/yum

# Create directories structure
RUN mkdir -p /etc/galaxy \
    && mkdir -p /var/log/galaxy \
    && mkdir -p /var/lib/galaxy/public \
    && chown galaxy:root /var/log/galaxy \
    && chmod g+w /var/log/galaxy

# Install python dependencies
ENV VENV_BIN /var/lib/galaxy/venv/bin
COPY requirements.txt /tmp/requirements.txt
RUN virtualenv /var/lib/galaxy/venv \
    && ${VENV_BIN}/pip install -U pip \
    && ${VENV_BIN}/pip install -r /tmp/requirements.txt

# Copy sources
# TODO(cutwater): Install galaxy as a wheel package using pip
COPY scripts/docker-release/entrypoint.sh /entrypoint.sh
COPY . /galaxy
RUN mv /galaxy/build/static /var/lib/galaxy/public/static

WORKDIR /galaxy

ENV DJANGO_SETTINGS_MODULE galaxy.settings.production

USER galaxy
EXPOSE 8000

ENTRYPOINT ["/entrypoint.sh"]
CMD ["run", "web"]
{'fraction_non_alphanumeric': 0.12861271676300579, 'fraction_numerical': 0.006502890173410405, 'mean_word_length': 2.989913544668588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '648939', 'n_tokens_mistral': 1024, 'n_tokens_neox': 995, 'n_words': 271}