FROM php:8.2-fpm

ENV TZ "America/Santiago"

RUN apt-get update && apt-get install -y --no-install-recommends cron && rm -r /var/lib/apt/lists/*

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

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

WORKDIR /code/bin

COPY ./cli/crontab /var/spool/cron/crontabs/root

CMD ["cron", "-f"]
