<commit_before># All images inherit from this
FROM node:10.16.3-alpine

# [INSTALL IMAGE DEPENDENCIES]

# dependencies that exist in all layers
RUN apk --no-cache add \
    bash \
    tini \
    g++ \
    ca-certificates \
    lz4-dev \
    musl-dev \
    openssl-dev \
    make \
    curl \
    python

ENV NPM_CONFIG_LOGLEVEL error
ENV WITH_SASL 0

# Install bunyan
RUN yarn global add \
    --silent \
    --ignore-optional \
    --no-progress \
    --no-emoji \
    --no-cache \
    bunyan

RUN mkdir -p /app/source

# [BUILD AND INSTALL THE CONNECTORS]
RUN apk --no-cache add \
    --virtual .build-deps \
    gcc \
    zlib-dev \
    bsd-compat-headers \
    py-setuptools

# Install any built-in connectors in /app/
# use npm because there isn't a package.json
WORKDIR /app

RUN npm init --yes > /dev/null \
    && npm install \
    --quiet \
    --no-package-lock \
    'terafoundation_kafka_connector@~0.5.2'

RUN apk del .build-deps

# [INSTALL AND BUILD PACKAGES]
WORKDIR /app/source
ENV NODE_ENV development

COPY package.json yarn.lock lerna.json .yarnrc /app/source/
COPY scripts /app/source/scripts

# remove the workspaces to the package.json
RUN ./scripts/docker-pkg-fix.js "pre"

# install both dev and production dependencies
RUN yarn \
    --prod=false \
    --no-progress \
    --frozen-lockfile \
    --ignore-optional

# add back the workspaces to the package.json
RUN ./scripts/docker-pkg-fix.js "post"

# Add all of the packages and other required files
COPY packages /app/source/packages

# install the missing packages
RUN yarn \
    --no-cache \
    --prod=false \
    --prefer-offline \
    --frozen-lockfile \
    --ignore-optional

COPY types /app/source/types
COPY tsconfig.json /app/source/

# link and build the missing packages
RUN yarn quick:setup

# [BUILD THE PRODUCTION IMAGE]
ENV NODE_ENV production

# verify @terascope/node-rdkafka is installed right
RUN node -e "require('@terascope/node-rdkafka')"

COPY service.js /app/source/

# verify teraslice is installed right
RUN node -e "require('teraslice')"

EXPOSE 5678

# set up the volumes<commit_msg>update Dockerfile to use official node-rdkafka npm package<commit_after># All images inherit from this
FROM node:10.16.3-alpine

# [INSTALL IMAGE DEPENDENCIES]

# dependencies that exist in all layers
RUN apk --no-cache add \
    bash \
    tini \
    g++ \
    ca-certificates \
    lz4-dev \
    musl-dev \
    openssl-dev \
    make \
    curl \
    python

ENV NPM_CONFIG_LOGLEVEL error
ENV WITH_SASL 0

# Install bunyan
RUN yarn global add \
    --silent \
    --ignore-optional \
    --no-progress \
    --no-emoji \
    --no-cache \
    bunyan

RUN mkdir -p /app/source

# [BUILD AND INSTALL THE CONNECTORS]
RUN apk --no-cache add \
    --virtual .build-deps \
    gcc \
    zlib-dev \
    bsd-compat-headers \
    py-setuptools

# Install any built-in connectors in /app/
# use npm because there isn't a package.json
WORKDIR /app

RUN npm init --yes > /dev/null \
    && npm install \
    --quiet \
    --no-package-lock \
    'terafoundation_kafka_connector@~0.5.3'

RUN apk del .build-deps

# [INSTALL AND BUILD PACKAGES]
WORKDIR /app/source
ENV NODE_ENV development

COPY package.json yarn.lock lerna.json .yarnrc /app/source/
COPY scripts /app/source/scripts

# remove the workspaces to the package.json
RUN ./scripts/docker-pkg-fix.js "pre"

# install both dev and production dependencies
RUN yarn \
    --prod=false \
    --no-progress \
    --frozen-lockfile \
    --ignore-optional

# add back the workspaces to the package.json
RUN ./scripts/docker-pkg-fix.js "post"

# Add all of the packages and other required files
COPY packages /app/source/packages

# install the missing packages
RUN yarn \
    --no-cache \
    --prod=false \
    --prefer-offline \
    --frozen-lockfile \
    --ignore-optional

COPY types /app/source/types
COPY tsconfig.json /app/source/

# link and build the missing packages
RUN yarn quick:setup

# [BUILD THE PRODUCTION IMAGE]
ENV NODE_ENV production

# verify node-rdkafka is installed right
RUN node -e "require('node-rdkafka')"

COPY service.js /app/source/

# verify teraslice is installed right
RUN node -e "require('teraslice')"

EXPOSE 5678

# set up the volumes
{'fraction_non_alphanumeric': 0.10530068932731163, 'fraction_numerical': 0.0066555740432612314, 'mean_word_length': 2.5331654072208227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '849740', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1426, 'n_words': 442}