FROM php:8.3-fpm # Install system dependencies RUN apt-get update && apt-get install -y \ nginx \ libpng-dev \ libjpeg-dev \ libfreetype6-dev \ libzip-dev \ zip \ unzip \ git \ curl \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install -j$(nproc) gd pdo pdo_mysql mysqli zip \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Install Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Configure nginx RUN rm -rf /etc/nginx/sites-enabled/default # Configure PHP-FPM RUN sed -i 's/listen = 127.0.0.1:9000/listen = 9000/g' /usr/local/etc/php-fpm.d/www.conf # Set working directory WORKDIR /var/www/html # Copy application files COPY ./src /var/www/html # Set permissions RUN chown -R www-data:www-data /var/www/html \ && chmod -R 755 /var/www/html # Expose port 80 EXPOSE 80 # Start PHP-FPM and Nginx CMD php-fpm -D && nginx -g 'daemon off;'