First, install the Xdebug package from the testing repository.
$ apk add php7-xdebug --repository http://dl-3.alpinelinux.org/alpine/edge/testing/
Now edit the /etc/php7/php.ini
file and add the following to the end of it:
zend_extension=/usr/lib/php7/modules/xdebug.so