FROM php:8-apache

WORKDIR /var/www/html

COPY . .

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN chmod +x /usr/local/bin/install-php-extensions

RUN install-php-extensions imagick

RUN docker-php-ext-enable imagick

RUN apt-get update && apt-get install -y ffmpeg git wget unzip vim

RUN wget https://use.fontawesome.com/releases/v5.15.1/fontawesome-free-5.15.1-web.zip
RUN unzip fontawesome-free-5.15.1-web.zip
RUN rm fontawesome-free-5.15.1-web.zip
RUN mv fontawesome-free-5.15.1-web /var/www/html/fontawesome

COPY --from=composer/composer:latest-bin /composer /usr/bin/composer
WORKDIR /var/www/html/php
RUN composer require php-ffmpeg/php-ffmpeg

RUN install -d -m 0755 -o www-data -g www-data /var/www/html/uploads
