# syntax = docker/dockerfile:1.0-experimental FROM php:7.4-apache as build RUN apt-get update && apt-get install -y libzip-dev RUN rm -rf /var/lib/apt/lists/* RUN docker-php-ext-configure zip RUN docker-php-ext-install -j$(nproc) zip # Install Xdebug RUN pecl install xdebug-2.9.8 RUN docker-php-ext-enable xdebug # Copy your custom php.ini file into the container COPY docker/php.ini /usr/local/etc/php/php.ini # Add Xdebug configuration to php.ini RUN echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.remote_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN a2enmod rewrite # Expose port 80 (for Apache) and port 9000 (for Xdebug) EXPOSE 80 9000 # Set the working directory WORKDIR /var/www/html # Start Apache in the foreground CMD ["apache2-foreground"]