Skip to content

Commit bbdab42

Browse files
authored
Merge pull request #4 from DEVizzent/configure_xdebug
Add xdebug configuration for local
2 parents 8871406 + 79af32a commit bbdab42

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ help: ## Display this help
88
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
99

1010

11-
install: composer-install up ## Install required software and initialize your local configuration
11+
install: composer-install build up ## Install required software and initialize your local configuration
12+
13+
build: ## Build application docker images
14+
@bash -c "docker-compose build ${PHP_CONTAINER_NAME}"
1215

1316
up: ## Start application containers and required services
1417
@bash -c "export MOCKSERVER_LOG_LEVEL=WARN; docker-compose up -d"

docker-compose.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ services:
33
php:
44
container_name: php
55
build:
6-
dockerfile: docker/php/Dockerfile
7-
context: .
6+
context: docker/php/
87
environment:
98
MOCKSERVER_URL: 'http://mockserver:1080'
9+
PHP_IDE_CONFIG: 'serverName=host.docker.internal'
10+
XDEBUG_TRIGGER: 1
11+
extra_hosts:
12+
host.docker.internal: host-gateway
1013
volumes:
1114
- .:/app
1215
tty: true

docker/php/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
FROM php:8.1
22

3+
RUN pecl install xdebug && \
4+
docker-php-ext-enable xdebug
5+
6+
COPY rootfs /
7+
38
WORKDIR /app
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
zend_extension=xdebug.so
2+
xdebug.mode=debug
3+
xdebug.start_with_request=yes
4+
xdebug.discover_client_host=false
5+
xdebug.idekey="MOCKSERVER_HELPER"
6+
xdebug.trigger_value="MOCKSERVER_HELPER"
7+
xdebug.client_port=9003
8+
xdebug.log_level=0
9+
xdebug.client_host=host.docker.internal

0 commit comments

Comments
 (0)