<commit_before>##################################
# Build
##################################
FROM node:14 as build

RUN mkdir -p /opt/build;

WORKDIR /opt/build

# Would be a bit simpler if the code was inside a top-level src folder
COPY ./backend ./backend
COPY ./components ./components
COPY ./pages ./pages
COPY ./public ./public
COPY ./shims ./shims
COPY ./transforms ./transforms
COPY [ \
  "babel.config.js", \
  "frontend.js", \
  "next.config.js", \
  "package.json", \
  "theme.js", \
  "yarn.lock", \
  "./" \
]

RUN yarn install \
  && yarn build

##################################
# Dependencies
##################################
FROM node:14 as dependencies

RUN DEBIAN_FRONTEND=noninteractive \
  apt-get update && \
  apt-get install --yes --no-install-recommends \
  build-essential \
  libcairo2-dev \
  libpango1.0-dev \
  libjpeg-dev \
  libgif-dev \
  librsvg2-dev

ENV NODE_ENV='production'

RUN mkdir -p /opt/build;

WORKDIR /opt/build

COPY --from=build [ "/opt/build/package.json", "/opt/build/yarn.lock", "./" ]

RUN yarn install --production=true

##################################
# Release
##################################
FROM node:14-slim as release

# Install tini
ARG TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini

ENV NODE_ENV='production'

RUN mkdir -p /opt/app;

WORKDIR /opt/app

COPY --from=build /opt/build/.next /opt/app/.next
COPY --from=build /opt/build/frontend.js /opt/app/
COPY --from=build /opt/build/lib /opt/app/lib
COPY --from=build /opt/build/public /opt/app/public
COPY --from=dependencies /opt/build/node_modules /opt/app/node_modules

ENV PORT=4000

EXPOSE 4000

ENTRYPOINT ["/tini", "-g", "--"]
CMD [ "node", "lib/index.js" ]
<commit_msg>Remove unnecessary ENV<commit_after>##################################
# Build
##################################
FROM node:14 as build

RUN mkdir -p /opt/build;

WORKDIR /opt/build

# Would be a bit simpler if the code was inside a top-level src folder
COPY ./backend ./backend
COPY ./components ./components
COPY ./pages ./pages
COPY ./public ./public
COPY ./shims ./shims
COPY ./transforms ./transforms
COPY [ \
  "babel.config.js", \
  "frontend.js", \
  "next.config.js", \
  "package.json", \
  "theme.js", \
  "yarn.lock", \
  "./" \
]

RUN yarn install \
  && yarn build

##################################
# Dependencies
##################################
FROM node:14 as dependencies

RUN DEBIAN_FRONTEND=noninteractive \
  apt-get update && \
  apt-get install --yes --no-install-recommends \
  build-essential \
  libcairo2-dev \
  libpango1.0-dev \
  libjpeg-dev \
  libgif-dev \
  librsvg2-dev

ENV NODE_ENV='production'

RUN mkdir -p /opt/build;

WORKDIR /opt/build

COPY --from=build [ "/opt/build/package.json", "/opt/build/yarn.lock", "./" ]

RUN yarn install --production=true

##################################
# Release
##################################
FROM node:14-slim as release

# Install tini
ARG TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini

ENV NODE_ENV='production'

RUN mkdir -p /opt/app;

WORKDIR /opt/app

COPY --from=build /opt/build/.next /opt/app/.next
COPY --from=build /opt/build/frontend.js /opt/app/
COPY --from=build /opt/build/lib /opt/app/lib
COPY --from=build /opt/build/public /opt/app/public
COPY --from=dependencies /opt/build/node_modules /opt/app/node_modules

ENTRYPOINT ["/tini", "-g", "--"]
CMD [ "node", "lib/index.js" ]

{'fraction_non_alphanumeric': 0.25574794209480556, 'fraction_numerical': 0.01021856372409878, 'mean_word_length': 3.489171974522293, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6829106', 'n_tokens_mistral': 1264, 'n_tokens_neox': 1214, 'n_words': 288}