<commit_before>FROM ruby:2.7.2-slim-buster as Ruby

##################################################
# Build Stage
##################################################
FROM Ruby as Build

ENV RACK_ENV production

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        gcc \
        make \
    && gem install bundler -v 2.0.2 \
    && bundle config --global frozen true \
    && bundle config --global no-cache 'true' \
    && bundle config --global without 'development test'

WORKDIR /usr/src/app

COPY Gemfile Gemfile.lock ./

RUN bundle install \
    && bundle clean --force \
    && rm -rf /usr/local/bundle/cache/*.gem \
    && find /usr/local/bundle/gems/ -name "*.c" -delete \
    && find /usr/local/bundle/gems/ -name "*.o" -delete

COPY . .

RUN bundle exec rake assets:precompile

##################################################
# Final Stage
##################################################
FROM Ruby

ENV RACK_ENV production

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        imagemagick \
    && rm -rf /var/lib/apt/lists/*

COPY --from=Build /usr/local/bundle /usr/local/bundle
COPY --from=Build /usr/src/app /usr/src/app

WORKDIR /usr/src/app

CMD ["bundle", "exec", "rackup", "--port", "8080"]<commit_msg>Use alpine as container base<commit_after>FROM ruby:2.7.2-alpine as Ruby

##################################################
# Build Stage
##################################################
FROM Ruby as Build

ENV RACK_ENV production

RUN apk add --no-cache \
        g++ \
        make \
    && bundle config --global frozen true \
    && bundle config --global without "development test"

WORKDIR /usr/src/app

COPY Gemfile Gemfile.lock ./

RUN bundle install \
    && bundle clean --force \
    && rm -rf /usr/local/bundle/cache/*.gem \
    && find /usr/local/bundle/gems/ -name "*.c" -delete \
    && find /usr/local/bundle/gems/ -name "*.o" -delete

COPY . .

RUN bundle exec rake assets:precompile

##################################################
# Final Stage
##################################################
FROM Ruby

ENV RACK_ENV production

RUN apk add --no-cache imagemagick

COPY --from=Build /usr/local/bundle /usr/local/bundle
COPY --from=Build /usr/src/app /usr/src/app

WORKDIR /usr/src/app

CMD ["bundle", "exec", "rackup", "--port", "8080"]
{'fraction_non_alphanumeric': 0.29143587558585426, 'fraction_numerical': 0.007243289305496378, 'mean_word_length': 3.1338028169014085, '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': '7602277', 'n_tokens_mistral': 730, 'n_tokens_neox': 701, 'n_words': 198}