<commit_before>ARG PYTHON_VERSION=3.7
ARG BASE_IMAGE=buster

FROM python:${PYTHON_VERSION}-${BASE_IMAGE} as builder

WORKDIR /build

RUN pip install pipenv && pip install --user --no-warn-script-location uwsgi

COPY Pipfile* ./
# To ensure all packages we need end up in .local for copying, we tell pipenv to install in system mode, meaning not in
# a virtual env. But then we also tell pip to install in --user mode, which forces install to $HOME/.local. Finally we
# ignore preinstalled modules so that .local actually ends up containing everything we want
RUN PIP_USER=1 PIP_IGNORE_INSTALLED=1 pipenv install --deploy --system

FROM python:${PYTHON_VERSION}-slim-${BASE_IMAGE} as app
LABEL Maintainer="Directive Games <<EMAIL>>"

RUN addgroup --gid 1000 uwsgi && useradd -ms /bin/bash uwsgi -g uwsgi

RUN UWSGI_RUNTIME_DEPS=libxml2 \
    && apt-get update \
    && apt-get install -y --no-install-recommends ${UWSGI_RUNTIME_DEPS}<commit_msg>Restrict pipenv version to avoid installation bug<commit_after>ARG PYTHON_VERSION=3.7
ARG BASE_IMAGE=buster

FROM python:${PYTHON_VERSION}-${BASE_IMAGE} as builder

WORKDIR /build

# Later versions of pipenv currently fail to observe the PIP_IGNORE_INSTALLED flag properly
RUN pip install pipenv==2020.6.2 && pip install --user --no-warn-script-location uwsgi

COPY Pipfile* ./
# To ensure all packages we need end up in .local for copying, we tell pipenv to install in system mode, meaning not in
# a virtual env. But then we also tell pip to install in --user mode, which forces install to $HOME/.local. Finally we
# ignore preinstalled modules so that .local actually ends up containing everything we want
RUN PIP_USER=1 PIP_IGNORE_INSTALLED=1 pipenv install --deploy --system

FROM python:${PYTHON_VERSION}-slim-${BASE_IMAGE} as app
LABEL Maintainer="Directive Games <<EMAIL>>"

RUN addgroup --gid 1000 uwsgi && useradd -ms /bin/bash uwsgi -g uwsgi

RUN UWSGI_RUNTIME_DEPS=libxml2 \
    && apt-get update \
    && apt-get install -y --no-install-recommends ${UWSGI_RUNTIME_DEPS}
{'fraction_non_alphanumeric': 0.09032576505429418, 'fraction_numerical': 0.011846001974333662, 'mean_word_length': 4.362433862433862, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1583258', 'n_tokens_mistral': 670, 'n_tokens_neox': 636, 'n_words': 243}