FROM php:7.4-fpm

WORKDIR /var/www/html

RUN docker-php-ext-install pdo pdo_mysql

RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        libzip-dev \
        zip \
        cron \
        supervisor \
        nano \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) gd \
  	&& docker-php-ext-install zip \
  	&& docker-php-ext-install bcmath

COPY --from=composer:1.9.3 /usr/bin/composer /usr/bin/composer

#NODEJS & NPM
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get -y install nodejs

RUN chown -R www-data:www-data /var/www
RUN chmod 755 /var/www