FROM bref/php-81-fpm:2

ARG COMPOSER_ALLOW_SUPERUSER=1
# Copy the source code in the image
# COPY .. /var/task
WORKDIR /var/task

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

COPY --from=bref/extra-gd-php-81:1 /opt /opt
COPY --from=bref/extra-imagick-php-81:1 /opt /opt

RUN composer install \
    --optimize-autoloader \
    --no-dev \
    --no-interaction \
    --prefer-dist

RUN php artisan route:cache

EXPOSE 8000
# Configure the handler file (the entrypoint that receives all HTTP requests)
CMD ["public/index.php"]