diff --git a/docs/06-installation/02-installation-guides/03-installing-in-development-mode-on-windows.md b/docs/06-installation/02-installation-guides/03-installing-in-development-mode-on-windows.md index 9310358e4..81a2fdafe 100644 --- a/docs/06-installation/02-installation-guides/03-installing-in-development-mode-on-windows.md +++ b/docs/06-installation/02-installation-guides/03-installing-in-development-mode-on-windows.md @@ -63,13 +63,17 @@ $ docker compose version ``` ::: -8. In `{shop_name}/docker/context/php/debug/etc/php/debug.conf.d/69-xdebug.ini`, set `xdebug.remote_host` and `xdebug.client_host` to `host.docker.internal`: +8. In `deploy.dev.yml`, set the debug configuration as follows: -```text -... -xdebug.remote_host=host.docker.internal -... -xdebug.client_host=host.docker.internal +```yaml +docker: + ... + debug: + enabled: true + xdebug: + enabled: true + custom_host_ip: host.docker.internal + ... ``` 9. Add your user to the `docker` group: diff --git a/docs/07-deploy-file/02-deploy.file.reference.v1.md b/docs/07-deploy-file/02-deploy.file.reference.v1.md index 9aded87d9..dcca1d6ad 100644 --- a/docs/07-deploy-file/02-deploy.file.reference.v1.md +++ b/docs/07-deploy-file/02-deploy.file.reference.v1.md @@ -753,6 +753,7 @@ docker: ``` * `docker: debug: xdebug: enabled:` - defines if Xdebug is enabled. +* `docker: debug: xdebug: custom_host_ip:` - defines the custom host IP. It can be set as `host.docker.internal` when working in Windows environment with WSL2. ### docker: maintenance: diff --git a/docs/09-troubleshooting.md b/docs/09-troubleshooting.md index 1398f3ccc..26a6b876c 100644 --- a/docs/09-troubleshooting.md +++ b/docs/09-troubleshooting.md @@ -271,6 +271,17 @@ docker: xdebug: enabled: true ``` +When working on Windows with WSL2, ensure the debug configuration is set up as follows: +```yaml +docker: + ... + debug: + enabled: true + xdebug: + enabled: true + custom_host_ip: host.docker.internal + ... +``` 2. Ensure that IDE is listening to the port 9000. 3. Check if the host is accessible from the container: ```bash diff --git a/generator/src/templates/deploy.bash.twig b/generator/src/templates/deploy.bash.twig index 7031fcc3c..7313847a7 100644 --- a/generator/src/templates/deploy.bash.twig +++ b/generator/src/templates/deploy.bash.twig @@ -139,6 +139,7 @@ readonly SPRYKER_DEFAULT_REGION="{{ regions | keys | first }}" {% endif %} readonly SPRYKER_FILE_MODE="{{ _fileMode }}" readonly SPRYKER_XDEBUG_MODE_ENABLE="{{ docker['debug']['xdebug']['enabled'] is not defined or docker['debug']['xdebug']['enabled'] == true ? '1' : '' }}" +readonly SPRYKER_CUSTOM_XDEBUG_HOST_IP="{{ docker['debug']['xdebug']['custom_host_ip'] | default('') }}" readonly SPRYKER_SYNC_SESSION_NAME="{{ _syncSessionName }}" readonly SPRYKER_SYNC_VOLUME="${SPRYKER_DOCKER_PREFIX}_${SPRYKER_DOCKER_TAG}_data_sync" readonly DOCKER_COMPOSE_FILES_EXTRA="{{ docker['compose']['yamls'] | default([]) | join(' ') }}" @@ -184,7 +185,7 @@ readonly SSH_AUTH_SOCK_IN_CLI="$([ -n "${SSH_AUTH_SOCK}" ] && [ -z "${COMPOSER_A # Global variables readonly USER_FULL_ID=$(Environment::getFullUserId) -readonly SPRYKER_XDEBUG_HOST_IP=$(Environment::getHostIp) +readonly SPRYKER_XDEBUG_HOST_IP=${SPRYKER_CUSTOM_XDEBUG_HOST_IP:-$(Environment::getHostIp)} readonly SECRETS_ENVIRONMENT=("COMPOSER_AUTH='${COMPOSER_AUTH}'") command=${1}