FROM php:8.3-cli

RUN apt-get update && apt-get install -y --no-install-recommends \
        git unzip libzip-dev libpng-dev libjpeg-dev libfreetype6-dev libicu-dev \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install pdo_mysql gd zip intl bcmath \
    && rm -rf /var/lib/apt/lists/*

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

# memory for the legacy import; OPcache for `artisan serve` (CLI), which is off by default.
# Files on a Windows bind mount are slow to read, so cache them and re-check every 2 seconds.
COPY php.ini /usr/local/etc/php/conf.d/st-manager.ini

WORKDIR /var/www/html
