FROM php:7.2-apache-buster
RUN docker-php-ext-install mysqli

RUN apt-get update -y && apt-get install -y libwebp-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libfreetype6-dev zlib1g-dev libzip-dev

RUN docker-php-ext-install zip

RUN docker-php-ext-configure gd --with-gd --with-webp-dir --with-jpeg-dir \
    --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir

RUN docker-php-ext-install gd

VOLUME /var/www/html/media

COPY . /var/www/html

RUN chown -R www-data:www-data /var/www/html