<commit_before>FROM python:3.10.4-alpine AS builder

ENV PIP_DISABLE_PIP_VERSION_CHECK=on

WORKDIR /src

RUN apk add --update --no-cache build-base~=0 make~=4 git~=2 libffi-dev~=3 py3-pip~=22 \
    && pip --no-cache-dir install poetry==1.1.13 poetry-dynamic-versioning==0.16.0 twine==4.0.1

COPY .git /src/.git

RUN git checkout -- . \
    && WHEEL_DEPS_DIR=/wheels/deps make build build-deps \
    && mv dist/*.whl /wheels/

# --- #

FROM python:3.10.4-alpine

ARG REVISION
ARG BUILD_TIME

LABEL org.opencontainers.image.title="crimson"
LABEL org.opencontainers.image.revision="${REVISION}"
LABEL org.opencontainers.image.created="${BUILD_TIME}"

ENV PIP_DISABLE_PIP_VERSION_CHECK=on

WORKDIR /runtime
COPY --from=builder /wheels /wheels

RUN apk add --update --no-cache py3-pip~=22 \
    && pip install --no-cache-dir --no-index --find-links=/wheels/deps /wheels/deps/* \
    && pip install --no-cache-dir --no-index --no-deps --find-links=/wheels crimson \
    && apk --purge del py3-pip \
    && rm -rf /wheels/

ENTRYPOINT ["crimson"]<commit_msg>chore: Sync Dockerfile builds to use Makefile rules<commit_after>FROM python:3.10.4-alpine AS builder

ENV PIP_DISABLE_PIP_VERSION_CHECK=on
ENV PIP_NO_CACHE_DIR=on

WORKDIR /src

RUN apk add --update --no-cache build-base~=0 make~=4 git~=2 libffi-dev~=3 py3-pip~=22

COPY .git /src/.git

RUN git checkout -- . \
    && WHEEL_DEPS_DIR=/wheels/deps make install-build build \
    && mv dist/*.whl /wheels/

# --- #

FROM python:3.10.4-alpine

ARG REVISION
ARG BUILD_TIME

LABEL org.opencontainers.image.title="crimson"
LABEL org.opencontainers.image.revision="${REVISION}"
LABEL org.opencontainers.image.created="${BUILD_TIME}"

ENV PIP_DISABLE_PIP_VERSION_CHECK=on
ENV PIP_NO_CACHE_DIR=on
ENV PIP_NO_INDEX=on

WORKDIR /app
COPY --from=builder /wheels /wheels

RUN apk add --update --no-cache py3-pip~=22 \
    && pip install --find-links=/wheels/deps /wheels/deps/* \
    && pip install --no-deps --find-links=/wheels crimson \
    && apk --purge del py3-pip \
    && rm -rf /wheels/

ENTRYPOINT ["crimson"]
{'fraction_non_alphanumeric': 0.15216334467671366, 'fraction_numerical': 0.023821098687408847, 'mean_word_length': 3.3694267515923566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '161633', 'n_tokens_mistral': 830, 'n_tokens_neox': 791, 'n_words': 172}