<commit_before>FROM php:7.4-fpm

ARG XDEBUG_VERSION=xdebug-2.8.0
ARG GD_FREETYPE_DIRECTIVE="--with-freetype=/usr/include/"
ARG GD_JPEG_DIRECTIVE="--with-jpeg=/usr/include/"
ARG MEMCACHED_VERSION=memcached
ARG PHP_ADDITIONAL_EXTENSIONS=""
RUN apt-get update && apt-get install -y gnupg \
    && curl -sSL https://packages.blackfire.io/gpg.key | apt-key add - \
    && echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list \
    && apt-get update \
    && apt-get install -y blackfire-php

# install common dependencies
# Adding some basic stuff to make chameleon run
RUN apt-get update && apt-get install -y \
    aspell \
    aspell-de \
    freetds-dev \
    jpegoptim \
    libcurl3-dev \
    libfreetype6-dev\
    libicu-dev \
    libjpeg-dev \
    libpng-dev \
    libmemcached-dev \
    libonig-dev \
    libtidy-dev \
    libzip-dev \
    libxml2-dev \
    locales \
    optipng \
    pngquant \
    unzip \
    zlib1g-dev \
    && locale-gen de_DE.UTF-8 \
    && locale-gen en_EN.UTF-8

# Adding layer for imagemagick. This adds A LOT of extra payload to this docker.
# Remove it if you don't need it
RUN apt-get update && apt-get install -y \
    imagemagick libmagickwand-dev libmagickcore-dev  \
    && pecl install imagick \
    && docker-php-ext-enable imagick

RUN docker-php-ext-configure gd "${GD_FREETYPE_DIRECTIVE}" "${GD_JPEG_DIRECTIVE}"
RUN docker-php-ext-install -j$(nproc) \
    bcmath \
    curl \
    gd \
    iconv \
    intl \
    mbstring \
    mysqli \
    opcache \
    pdo_mysql \
    soap \
    sockets \
    tidy \
    zip ${PHP_ADDITIONAL_EXTENSIONS}

# add ms sql server support for PDO
RUN ln -s /usr/lib/x86_64-linux-gnu/libsybdb.a /usr/lib/ \
    && docker-php-ext-install -j$(nproc) pdo_dblib

RUN pecl install ${MEMCACHED_VERSION} \
    && docker-php-ext-enable memcached

RUN pecl install ${XDEBUG_VERSION} \
    && docker-php-ext-enable xdebug

ENV GOSU_VERSION 1.11
RUN set -x \
    && apt-get update && apt-get install -y --no-install-recommends gpg dirmngr ca-certificates wget && rm -rf /var/lib/apt/lists/* \
    && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
    && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
    && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
    && export GNUPGHOME="$(mktemp -d)" \
    && gpg --no-tty --keyserver "hkp://keyserver.ubuntu.com:80" --recv-keys <KEY> \
    && gpg --no-tty --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
    && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \
    && chmod +x /usr/local/bin/gosu \
    && gosu nobody true \
    && apt-get purge -y --auto-remove


COPY config/php.ini /usr/local/etc/php/
COPY config/proxy.conf /usr/local/etc/php-fpm.d/<commit_msg>build php 7.4 public image<commit_after>FROM php:7.4-fpm

ARG GD_FREETYPE_DIRECTIVE="--with-freetype-dir=/usr/include/"
ARG GD_JPEG_DIRECTIVE="--with-jpeg-dir=/usr/include/"

# Adding some basic stuff to make chameleon run
RUN apt-get update && apt-get install -y \
    aspell \
    aspell-de \
    freetds-dev \
    libmemcached-dev \
    libtidy-dev \
    libzip-dev \
    locales \
    unzip \
    zlib1g-dev \
    libonig-dev \
    git \
    && locale-gen de_DE.UTF-8 \
    && locale-gen en_EN.UTF-8

RUN git clone -b master --single-branch https://github.com/php-memcached-dev/php-memcached.git \
    && ( \
        cd php-memcached \
        && phpize \
        && ./configure \
        && make -j$(nproc) \
        && make install \
       ) \
    && rm -rf php-memcached \
    && ln -s /usr/lib/x86_64-linux-gnu/libsybdb.a /usr/lib/ \
    && docker-php-ext-enable memcached \
    && docker-php-ext-install -j$(nproc) opcache iconv  pdo_mysql pdo_dblib tidy

# Adding layer for imagemagick. This adds A LOT of extra payload to this docker.
# Remove it if you don't need it
RUN apt-get update && apt-get install -y \
    imagemagick libmagickwand-dev libmagickcore-dev jpegoptim optipng pngquant libcurl3-dev libicu-dev \
    && pecl install imagick \
    && docker-php-ext-enable imagick
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install -j$(nproc) gd soap zip opcache bcmath sockets curl intl mysqli

RUN pecl install xdebug \
    && docker-php-ext-enable xdebug

ENV GOSU_VERSION 1.11
RUN set -x \
    && apt-get update && apt-get install -y --no-install-recommends \
     gpg-agent \
     gpg dirmngr ca-certificates wget && rm -rf /var/lib/apt/lists/* \
    && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
    && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
    && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
    && export GNUPGHOME="$(mktemp -d)" \
    && gpg --no-tty --keyserver "hkp://keyserver.ubuntu.com:80" --recv-keys <KEY> \
    && gpg --no-tty --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
    && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \
    && chmod +x /usr/local/bin/gosu \
    && gosu nobody true \
    && apt-get purge -y --auto-remove

# pre-installing blackfire
#RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
#    && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
#    && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp

# installing blackfire cli
RUN mkdir -p /tmp/blackfire \
    && curl -A "Docker" -L https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire \
    && mv /tmp/blackfire/blackfire /usr/bin/blackfire \
    && rm -Rf /tmp/blackfire

COPY config/php.ini /usr/local/etc/php/
COPY config/proxy.conf /usr/local/etc/php-fpm.d/
{'fraction_non_alphanumeric': 0.15091463414634146, 'fraction_numerical': 0.0072831978319783195, 'mean_word_length': 2.4817216981132075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5261776', 'n_tokens_mistral': 2336, 'n_tokens_neox': 2231, 'n_words': 473}