FROM php:8.3-fpm # Install system dependencies RUN apt-get update && apt-get install -y \ git \ curl \ libpng-dev \ libonig-dev \ libxml2-dev \ libpq-dev \ zip \ unzip \ nginx \ supervisor # Install Node.js and NPM RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs # Clear cache RUN apt-get clean && rm -rf /var/lib/apt/lists/* # Install PHP extensions RUN docker-php-ext-install pdo pdo_mysql pdo_pgsql pgsql mysqli mbstring exif pcntl bcmath gd # Get latest Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Create system user to run Composer and Artisan Commands RUN useradd -G www-data,root -u 1000 -d /home/laravel laravel RUN mkdir -p /home/laravel/.composer && \ chown -R laravel:laravel /home/laravel # Set working directory WORKDIR /var/www # Copy nginx configuration COPY nginx.conf /etc/nginx/sites-available/default # Copy supervisor configuration COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf # Copy PHP configuration COPY php.ini /usr/local/etc/php/conf.d/custom.ini # Expose port 80 EXPOSE 80 # Start supervisor CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]