-
Notifications
You must be signed in to change notification settings - Fork 7
Enable Xdebug in dev #60
Changes from all commits
b9b2e28
2897101
4b60c31
177959b
12b95cf
99341fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| resolver 127.0.0.11; # Docker's embedded DNS server | ||
|
|
||
| map $cookie_XDEBUG_SESSION $fastcgi_pass { | ||
| default app; | ||
| ~.+ app-debug; | ||
| } | ||
|
|
||
| server { | ||
| server_name localhost; | ||
| listen 80; | ||
|
|
@@ -14,7 +21,8 @@ server { | |
| include fastcgi_params; | ||
| internal; | ||
|
|
||
| fastcgi_pass app:9000; | ||
| fastcgi_pass $fastcgi_pass:9000; | ||
| fastcgi_read_timeout 1d; # For Xdebug | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like variables can't be set with |
||
| fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||
|
|
||
| fastcgi_param SCRIPT_FILENAME /app/public/$fastcgi_script_name; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| xdebug.remote_enable = 1 | ||
| xdebug.remote_host = host.docker.internal | ||
| xdebug.remote_port = 9000 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,3 +110,22 @@ COPY .docker/php-dev.ini ${PHP_INI_DIR}/conf.d/01-app.ini | |
|
|
||
| RUN bin/console assets:install && \ | ||
| rm -rf var/* | ||
|
|
||
|
|
||
|
|
||
| # | ||
| # Stage: Debug environment | ||
| # | ||
| FROM dev AS debug | ||
|
|
||
| RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \ | ||
| pecl install \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like compiling things for a dynamic language, but no alternative There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did wonder if the compilation could be done separately and the result copied in to save app changes from re-running it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory the end result is just a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will ignore for now, can revisit if it does become annoying. |
||
| xdebug-2.7.0 \ | ||
| && \ | ||
| docker-php-ext-enable \ | ||
| xdebug \ | ||
| && \ | ||
| apk del .build-deps && \ | ||
| rm -rf /var/cache/apk/ | ||
|
|
||
| COPY .docker/php-debug.ini ${PHP_INI_DIR}/conf.d/02-app.ini | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,22 @@ services: | |
| - ./:/app | ||
| - /app/var | ||
| - /app/vendor | ||
| app-debug: | ||
| build: | ||
| context: . | ||
| target: debug | ||
| environment: | ||
| API_URI: http://web:8080 | ||
| APP_SECRET: | ||
| DEFAULT_LOCALE: ${DEFAULT_LOCALE:-en} | ||
| volumes: | ||
| - ./:/app | ||
| - /app/var | ||
| - /app/vendor | ||
| depends_on: | ||
| - api | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is basically a copy of |
||
| web: | ||
| depends_on: | ||
| - api | ||
| - app | ||
| - app-debug | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this needs to set something specific in the IDE/host, it would need documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work with any value.