FROM php:8.1-fpm # Install dependencies RUN apt-get update && apt-get install -y \ libpq-dev \ zip unzip curl git \ && docker-php-ext-install pdo_pgsql # Install Composer COPY --from=composer:2 /usr/bin/composer /usr/bin/composer # Set working directory WORKDIR /var/www # Copy source COPY . . # Copy default env COPY .env.example .env # Install Laravel dependencies RUN composer install --no-interaction --prefer-dist --optimize-autoloader # Generate Laravel app key RUN php artisan key:generate # Set permissions for Laravel RUN chown -R www-data:www-data /var/www \ && chmod -R 755 /var/www \ && chmod -R 775 storage bootstrap/cache \ && chown -R www-data:www-data storage bootstrap/cache EXPOSE 9000 CMD ["php-fpm"]