<commit_before>FROM elixir:1.8.1 AS build-env

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive \
       apt-get install -y --no-install-recommends \
               curl ca-certificates sudo locales \
               apt-transport-https \
               iproute2 can-utils \
               vim tmux \
               build-essential git make gcc cmake cmake-curses-gui

ENV LANG en_US.UTF-8
RUN echo "en_US.UTF-8 UTF-8" >/etc/locale.gen && locale-gen

ARG MIX_ENV=prod

RUN mix local.hex --force
RUN mix local.rebar --force

COPY mix.exs mix.lock /signalbroker/
COPY apps /signalbroker/apps
COPY config /signalbroker/config
COPY rel /signalbroker/rel
WORKDIR /signalbroker
RUN rm -rf _build
RUN rm -rf deps
RUN rm -rf apps/app_ngcan/priv
RUN mix deps.get
# RUN mix test --only success
RUN mix release


FROM debian:stretch

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive \
       apt-get install -y --no-install-recommends \
               locales \
               libssl1.1

ENV LANG en_US.UTF-8
RUN echo "en_US.UTF-8 UTF-8" >/etc/locale.gen && locale-gen

WORKDIR /signalbroker
COPY --from=build-env signalbroker/_build /signalbroker/_build/
COPY configuration /signalbroker/_build/prod/rel/signal_server/configuration

<commit_msg>Added envsubst utility from gettext to replace ENV VAR in text files. This utility can be used to replace env var in template files<commit_after>FROM elixir:1.8.1 AS build-env

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive \
       apt-get install -y --no-install-recommends \
               curl ca-certificates sudo locales \
               apt-transport-https \
               iproute2 can-utils \
               vim tmux \
               build-essential git make gcc cmake cmake-curses-gui \
               gettext

ENV LANG en_US.UTF-8
RUN echo "en_US.UTF-8 UTF-8" >/etc/locale.gen && locale-gen

ARG MIX_ENV=prod

RUN mix local.hex --force
RUN mix local.rebar --force

COPY mix.exs mix.lock /signalbroker/
COPY apps /signalbroker/apps
COPY config /signalbroker/config
COPY rel /signalbroker/rel
WORKDIR /signalbroker
RUN rm -rf _build
RUN rm -rf deps
RUN rm -rf apps/app_ngcan/priv
RUN mix deps.get
# RUN mix test --only success
RUN mix release


FROM debian:stretch

RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive \
       apt-get install -y --no-install-recommends \
               locales \
               libssl1.1

ENV LANG en_US.UTF-8
RUN echo "en_US.UTF-8 UTF-8" >/etc/locale.gen && locale-gen

WORKDIR /signalbroker
COPY --from=build-env signalbroker/_build /signalbroker/_build/
COPY --from=build-env /usr/bin/envsubst /usr/bin/envsubst
COPY configuration /signalbroker/_build/prod/rel/signal_server/configuration


{'fraction_non_alphanumeric': 0.09080841638981174, 'fraction_numerical': 0.008859357696566999, 'mean_word_length': 2.4832904884318765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2923499', 'n_tokens_mistral': 927, 'n_tokens_neox': 894, 'n_words': 256}