FROM php:8.5.1-fpm-alpine3.23

# Install system deps
RUN apk add --no-cache bash git icu-dev libzip-dev oniguruma-dev

# Install PHP extensions
RUN docker-php-ext-configure intl \
    && docker-php-ext-install -j$(nproc) intl pdo pdo_mysql opcache

# Install composer
ENV COMPOSER_ALLOW_SUPERUSER=1 \
    COMPOSER_HOME=/tmp/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

# Configure PHP
COPY php.ini $PHP_INI_DIR/conf.d/zz-custom.ini

WORKDIR /var/www/html

# Default command
CMD ["php-fpm"]
