Skip to content

Commit 1a7d624

Browse files
author
gluafamichl
committed
Add: devcontainer support for JetBrains IDEs, including debugging support for PHPStorm using xdebug session
1 parent ca875e0 commit 1a7d624

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
],
99
"workspaceFolder": "/var/www/html",
1010
"customizations": {
11+
"jetbrains" : {
12+
"settings" : {
13+
"Docker:app:DockerSettings.dockerComposePath" : "/usr/bin/docker",
14+
"Docker:app:DockerSettings.dockerPath" : "/usr/bin/docker"
15+
}
16+
},
1117
"vscode": {
1218
"extensions": [
1319
"xdebug.php-debug",
@@ -53,5 +59,6 @@
5359
"NODE_OPTIONS": "--use-openssl-ca"
5460
},
5561
"remoteUser": "vscode",
62+
"overrideCommand": false,
5663
"postStartCommand": "composer install --working-dir=/var/www/html/"
5764
}

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,13 @@ ENTRYPOINT [ "docker-entrypoint.sh" ]
9393
FROM hashtopolis-server-base as hashtopolis-server-dev
9494

9595
# Setting up development requirements, install xdebug
96-
RUN yes | pecl install xdebug \
96+
RUN yes | pecl install xdebug && docker-php-ext-enable xdebug \
9797
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
9898
&& echo "xdebug.mode = debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
9999
&& echo "xdebug.start_with_request = yes" >> /usr/local/etc/php/conf.d/xdebug.ini \
100100
&& echo "xdebug.client_port = 9003" >> /usr/local/etc/php/conf.d/xdebug.ini \
101+
&& echo "xdebug.client_host = localhost" >> /usr/local/etc/php/conf.d/xdebug.ini \
102+
&& echo "xdebug.idekey = PHPSTORM" >> /usr/local/etc/php/conf.d/xdebug.ini \
101103
\
102104
# Configuring PHP
103105
&& touch "/usr/local/etc/php/conf.d/custom.ini" \

0 commit comments

Comments
 (0)