# Base image FROM php:8.3-fpm-alpine # Install required extensions RUN docker-php-ext-install pdo pdo_mysql bcmath # Install Composer COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer # Set working directory WORKDIR /var/www # Copy the rest of the Laravel application COPY . /var/www # Ensure required Laravel directories exist and set permissions RUN mkdir -p /var/www/storage /var/www/bootstrap/cache && \ chown -R www-data:www-data /var/www && \ chmod -R 775 /var/www/storage /var/www/bootstrap/cache