Add Xdebug instruction and proper Docker Compose configuration

This commit is contained in:
Alessandro Lai
2021-09-22 10:53:38 +02:00
committed by Alessandro
parent ec6b1befdf
commit a38ed1f877
3 changed files with 14 additions and 0 deletions

View File

@@ -55,3 +55,6 @@ services:
## Updating the submodule
This site uses the master branch of the [main PHP-FIG repository](https://github.com/php-fig/fig-standards) as a Git submodule to pull content from it.
If you need to update it, you can use the `bin/update_submodule.sh` script to pull new commits. Afterwards, you can commit the differences in this repo, to push the updates afterwards.
## Using Xdebug
If you need to debug the site build, you can enable Xdebug. To do it, you need to copy `docker-compose.override.dist.yml` as `docker-compose.override.yml` so that your local Docker Compose configuration loads that configuration. This (after a container reload) will put Xdebug in `debug` mode. Once done that, you need to configure your IDE to catch to that. Xdebug will automatically connect back your host system thanks to the `host.docker.internal` special hostname, with a serverName of `PHP-FIG`, as defined in `docker-compose.yml`.

View File

@@ -0,0 +1,6 @@
version: '3.5'
services:
php:
environment:
XDEBUG_MODE: 'debug'

View File

@@ -7,6 +7,11 @@ services:
user: fig
volumes:
- .:/fig-website
- ./docker/php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
PHP_IDE_CONFIG: "serverName=PHP-FIG"
working_dir: /fig-website
command:
- 'sculpin'