<commit_before>FROM node:12 as compiler

WORKDIR /usr/src/prism

COPY package.json yarn.lock /usr/src/prism/
COPY packages/ /usr/src/prism/packages/

RUN yarn && yarn build

###############################################################
FROM node:12 as dependencies

WORKDIR /usr/src/prism/

COPY package.json /usr/src/prism/
RUN mkdir -p /usr/src/prism/node_modules

COPY packages/core/package.json /usr/src/prism/packages/core/
RUN mkdir -p /usr/src/prism/packages/core/node_modules

COPY packages/http/package.json /usr/src/prism/packages/http/
RUN mkdir -p /usr/src/prism/packages/http/node_modules

COPY packages/http-server/package.json /usr/src/prism/packages/http-server/
RUN mkdir -p /usr/src/prism/packages/http-server/node_modules

COPY packages/cli/package.json /usr/src/prism/packages/cli/
RUN mkdir -p /usr/src/prism/packages/cli/node_modules

ENV NODE_ENV production
RUN yarn --production

RUN curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | bash
RUN ./bin/node-prune

###############################################################
FROM node:12-alpine

WORKDIR /usr/src/prism
ARG BUILD_TYPE=development
ENV NODE_ENV production<commit_msg>skip install & use node-prune for arm64 image build (#1985)<commit_after>FROM node:12 as compiler

WORKDIR /usr/src/prism

COPY package.json yarn.lock /usr/src/prism/
COPY packages/ /usr/src/prism/packages/

RUN yarn && yarn build

###############################################################
FROM node:12 as dependencies

WORKDIR /usr/src/prism/

COPY package.json /usr/src/prism/
RUN mkdir -p /usr/src/prism/node_modules

COPY packages/core/package.json /usr/src/prism/packages/core/
RUN mkdir -p /usr/src/prism/packages/core/node_modules

COPY packages/http/package.json /usr/src/prism/packages/http/
RUN mkdir -p /usr/src/prism/packages/http/node_modules

COPY packages/http-server/package.json /usr/src/prism/packages/http-server/
RUN mkdir -p /usr/src/prism/packages/http-server/node_modules

COPY packages/cli/package.json /usr/src/prism/packages/cli/
RUN mkdir -p /usr/src/prism/packages/cli/node_modules

ENV NODE_ENV production
RUN yarn --production

RUN if [ $(uname -m) != "aarch64" ]; then curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | bash; fi
RUN if [ $(uname -m) != "aarch64" ]; then ./bin/node-prune; fi

###############################################################
FROM node:12-alpine

WORKDIR /usr/src/prism
ARG BUILD_TYPE=development
ENV NODE_ENV production
{'fraction_non_alphanumeric': 0.2160096540627514, 'fraction_numerical': 0.008849557522123894, 'mean_word_length': 4.4183006535947715, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3243729', 'n_tokens_mistral': 885, 'n_tokens_neox': 838, 'n_words': 179}