Skip to content

Instantly share code, notes, and snippets.

@alexbenfica
Last active March 17, 2022 21:26
Show Gist options
  • Save alexbenfica/658d9ed2333b2db8aa759017848ee435 to your computer and use it in GitHub Desktop.
Save alexbenfica/658d9ed2333b2db8aa759017848ee435 to your computer and use it in GitHub Desktop.
Dockerfile for WordPress development with PHP xDebug
FROM wordpress:4.9.6-php7.2-apache
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
nano \
gnupg1 \
gnupg2 \
nodejs \
ca-certificates \
git \
webp
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"' \
>> /usr/local/etc/php/php.ini
RUN echo 'xdebug.remote_port=9000' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.remote_handler=dbgp' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.remote_connect_back=0' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.idekey=docker' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.remote_host=192.168.1.110' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.profiler_output_dir="cachegrind.out.%p"' >> /usr/local/etc/php/php.ini
RUN echo 'xdebug.profiler_enable=1' >> /usr/local/etc/php/php.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment