Skip to content

Commit 4933281

Browse files
author
Andreas Sacher
committed
TASK: Update README.md
1 parent c3d660b commit 4933281

File tree

1 file changed

+38
-27
lines changed

1 file changed

+38
-27
lines changed

README.md

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ between your PHP file and the proxy class.
1616
Build your own
1717
--------------
1818

19+
When you just want to use this inside Docker you probably want to scroll further down and skip until you reach the **Use with Docker** part. No need to build it on your host machine yourself.
20+
1921
# Get the dependecies
2022
go get
2123
# Build
@@ -43,57 +45,66 @@ Show help
4345
Use with Docker
4446
---------------
4547

46-
Use the [official docker image](https://hub.docker.com/r/dfeyer/flow-debugproxy/) and follow the instruction for the configuration.
47-
48-
##### PHP configuration
48+
Make sure xdebug is installed in your dev container. You can use drydock for this or add the following to your development Dockerfile
4949

5050
```
51-
[Xdebug]
52-
zend_extension=/.../xdebug.so
53-
xdebug.remote_enable=1
54-
xdebug.idekey=PHPSTORM
55-
; The IP or name of the proxy container
56-
xdebug.remote_host=debugproxy
57-
; The proxy port (9010 by default, to not have issue is you use PHP FPM, already on port 9000)
58-
xdebug.remote_port=9010
59-
;xdebug.remote_log=/tmp/xdebug.log
51+
# install xdebug
52+
RUN yes | pecl install xdebug
53+
RUN echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini
6054
```
55+
#### Docker Compose
6156

62-
You can use the `xdebug.remote_log` to debug the protocol between your container and the proxy, it's useful to catch network issues.
63-
64-
##### Docker Compose
65-
66-
This is an incomplete Docker Compose configuration:
57+
This is an incomplete Docker Compose configuration showing all relevant settings for the debugproxy:
6758

6859
```
6960
services:
61+
neos:
62+
...
63+
volume:
64+
7065
debugproxy:
7166
image: dfeyer/flow-debugproxy:latest
7267
volumes:
73-
- .:/data
68+
- neos_data_tempory:/neos/Data/Temporary:ro
7469
environment:
7570
# This MUST be the IP address of the IDE (your computer)
76-
- "IDE_IP=192.168.1.130"
77-
# This is the default value, need to match the xdebug.remote_port on your php.ini
78-
- "XDEBUG_PORT=9010"
71+
IDE_PORT: 9003
72+
# This is the default value, need to match the xdebug.client_port and FLOW_CONTEXT environment variable
73+
XDEBUG: Docker/Testing:9001,Docker/Development:9002
74+
# must match the path used in the volume
75+
LOCAL_ROOT: /neos
7976
# Use this to enable verbose debugging on the proxy
80-
# - "ADDITIONAL_ARGS=-vv --debug"
77+
#ADDITIONAL_ARGS: "-vv --debug"
8178
networks:
8279
- backend
8380
8481
# This is your application containers, you need to link it to the proxy
8582
app:
8683
# The proxy need an access to the project files, to be able to do the path mapping
84+
# make sure the path is the one actually used by neos and exists in the container
85+
# if it is created by this command neos won't be able to write any temporary cache data due to right issues!
8786
volumes:
88-
- .:/data
89-
links:
90-
- debugproxy
87+
neos_data_tempory:/app/Data/Temporary:rw,cached
88+
89+
volumes:
90+
neos_data_temporary: {}
9191
```
9292

93+
When running the debugger make sure to include interpreter options for xdebug to tell it about your debug proxy. For example using the above compose file when debugging a test in the Docker/Testing context you would use:
94+
95+
```
96+
-dxdebug.client_host=debugproxy -dxdebug.client_port=9001
97+
```
98+
99+
**Depending on your IDE set this setting as late as possible!**
100+
101+
IntelliJ/PHPStorm for example set these command line options on their own, overriding them if you set them in your xdebug.ini. You will need to add them to the configuration of each actual test to make sure these settings have precedence!
102+
93103
**Options summary:**
94-
* `IDE_IP` The primary local W-/LAN IP of your machine where your IDE runs on
104+
* `IDE_IP` The primary local W-/LAN IP of your machine where your IDE runs on, defaults to docker.host.internal
95105
* `IDE_PORT` The Port your IDE is listening for incoming xdebug connections. (The port the debug proxy will try to connect to)
96-
* `XDEBUG_PORT` The port on which xdebug will try to establish a connection (to this container)
106+
* `XDEBUG` The flow context to port mapping. Based on the port xdebug connects to the context will be determined by this container
107+
* `LOCAL_ROOT` The path where the Data/Temporary directory will be mounted to. Used to determine the path mapping
97108
* `FRAMEWORK` Currently supported values: `flow` and `dummy`
98109
* `ADDITIONAL_ARGS` For any additional argument like verbosity flags (`-vv`) or debug mode (`--debug`) (or both)
99110

0 commit comments

Comments
 (0)