FROM php:7.2-fpm
RUN apt-get update && apt-get install -y \
    wget git unzip \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    && pecl install xdebug-2.7.1 \
    && docker-php-ext-enable xdebug \
    && docker-php-ext-install -j$(nproc) iconv \
    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install -j$(nproc) gd mbstring pdo pdo_mysql


#RUN apt-get update && apt-get install -y \
#    wget git unzip \
#    libfreetype6-dev \
#    libjpeg62-turbo-dev \
#    libpng-dev \
#    && pecl install xdebug-2.7.1 \
#    && docker-php-ext-enable xdebug \
#    && rm -rf /var/lib/apt/lists/* \
#    && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-png-dir=/usr --with-jpeg-dir=/usr \
#    && docker-php-ext-install -j$(nproc) gd mbstring pdo pdo_mysql pdo_pgsql


ADD ./php.ini /usr/local/etc/php/php.ini

RUN wget https://getcomposer.org/installer -O - -q \
    | php -- --install-dir=/bin --filename=composer --quiet

WORKDIR /var/www
