wordpress-stack-with-xdebug/Dockerfile-wordpress-xdebug
2023-03-12 01:35:53 +08:00

25 lines
901 B
Plaintext

# Original: https://marioyepes.com/setup-debug-php-docker-visual-studio-code
ARG DOCKER_IMG_TAG
# Source image
FROM wordpress:${DOCKER_IMG_TAG}
# We're going to use this path multile times. So save it in a variable.
ARG XDEBUG_INI="/usr/local/etc/php/conf.d/xdebug.ini"
COPY ./wordpress-xdebug/plugins /root/wp-plugins
# Install AND configure Xdebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& echo "[xdebug]" > $XDEBUG_INI \
&& echo "xdebug.mode = debug" >> $XDEBUG_INI \
&& echo "xdebug.start_with_request = trigger" >> $XDEBUG_INI \
&& echo "xdebug.client_port = 9003" >> $XDEBUG_INI \
&& echo "xdebug.client_host = 'host.docker.internal'" >> $XDEBUG_INI \
&& echo "xdebug.log = /tmp/xdebug.log" >> $XDEBUG_INI
RUN cp -Rf /root/wp-plugins/* /var/www/html/wp-content/plugins/ \
&& chown -R www-data:www-data /var/www/html/wp-content/plugins/