FROM php:8.4-fpm-alpine

# System dependencies
RUN apk add --no-cache curl-dev

# PHP extensions
RUN docker-php-ext-install pdo pdo_mysql curl opcache

# Custom PHP config
COPY docker/php.ini /usr/local/etc/php/conf.d/custom.ini

WORKDIR /var/www/nis2-agile

COPY . .

# Create uploads directory and set permissions
RUN mkdir -p /var/www/nis2-agile/public/uploads/visure \
    && chown -R www-data:www-data /var/www/nis2-agile

EXPOSE 9000
