Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to set up a custom Xdebug host IP #255

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fe9422b
Add the ability to set up a custom Xdebug host IP
peresypkin Nov 3, 2021
13deb2f
Update documentation
peresypkin May 30, 2022
39672f6
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Sep 20, 2022
a769741
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Sep 27, 2022
aebf14f
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Oct 14, 2022
36c21cd
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Nov 9, 2022
a643097
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Nov 29, 2022
7788b40
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Dec 12, 2022
39b9dd6
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Jan 16, 2023
8130974
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Feb 8, 2023
8099c5a
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Mar 3, 2023
367b77e
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Mar 9, 2023
3c79843
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Apr 13, 2023
f3b94cb
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Apr 25, 2023
f41c156
Merge branch 'master' into custom-xdebug-host-ip
peresypkin May 23, 2023
a36decc
Merge branch 'master' into custom-xdebug-host-ip
peresypkin May 27, 2023
0065d1f
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Jul 12, 2023
615b943
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Jul 25, 2023
136b156
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Aug 2, 2023
3ca2f40
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Sep 14, 2023
385744a
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Nov 20, 2023
9d7f628
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Dec 5, 2023
1d2511d
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Mar 4, 2024
869d3c3
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Mar 22, 2024
ec77537
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Apr 9, 2024
6c89317
Merge branch 'master' into custom-xdebug-host-ip
peresypkin May 7, 2024
b30118d
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Jun 10, 2024
5e3eacc
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Jul 9, 2024
9c7f56c
Merge branch 'master' into custom-xdebug-host-ip
peresypkin Jul 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions docs/07-deploy-file/02-deploy.file.reference.v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,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:
Expand Down
11 changes: 11 additions & 0 deletions docs/09-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion generator/src/templates/deploy.bash.twig
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,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(' ') }}"
Expand Down Expand Up @@ -178,7 +179,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}
Expand Down
Loading