FROM php:7.4-fpm

# install git and necesarry tools
RUN apt-get update && apt-get install -y zip unzip git

# install composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
    && php -r "if (hash_file('sha384', 'composer-setup.php') === 'c5b9b6d368201a9db6f74e2611495f369991b72d9c8cbd3ffbc63edff210eb73d46ffbfce88669ad33695ef77dc76976') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
    && php composer-setup.php \
    && php -r "unlink('composer-setup.php');" \
    && mv composer.phar /usr/local/bin/composer

COPY . /var/www/html

RUN docker-php-ext-install pdo_mysql
RUN composer install --ignore-platform-reqs

# expose artisan port
EXPOSE 8000
