# Use the Bref PHP 8.2 FPM development image
FROM bref/php-82-fpm-dev:latest

# Install MySQL client and any other tools (no PHP-GD here since it's added via Bref layer)
RUN yum install -y \
    mysql \
    && yum clean all


# Copy the application files to /var/task (this is where Bref expects the app)
COPY . /var/task

# Ensure cache and log directories are writable by any user (useful for local development)
RUN mkdir -p /var/task/var/cache /var/task/var/log && \
    chmod -R 777 /var/task/var/cache /var/task/var/log

# Use the default PHP-FPM entrypoint
CMD ["public/index.php"]