FROM bref/php-82-fpm:2

# Copy the source code in the image
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY .. /var/task

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

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

RUN php artisan route:cache

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