FROM php:8.1-fpm

RUN apt-get update && apt-get install -y --no-install-recommends libzip-dev libicu-dev git libpng-dev unzip tzdata \
    && rm -r /var/lib/apt/lists/*

RUN docker-php-ext-install pdo pdo_mysql zip intl gd bcmath

RUN pecl install xdebug-3.1.3 \
    && docker-php-ext-enable xdebug

COPY ./php-errors.ini /usr/local/etc/php/conf.d/docker-php-errors.ini
COPY ./php-xdebug.ini /usr/local/etc/php/conf.d/docker-php-xdebug.ini
COPY ./php-memory.ini /usr/local/etc/php/conf.d/docker-php-memory.ini

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

WORKDIR /code
