Boa tarde Devs tudo certo, estou tendo problemas ao tentar executar o xdebug com docker no ubuntu 20.04. Abaixo segue minhas config.
Docker-compose.yml
version: '3.7'
networks:
supervisao:
services:
nginx:
image: nginx:stable-alpine
container_name: supervisao-web
ports:
- "80:80"
volumes:
- .:/var/www/html/
- ./.docker/web/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php
- mysql
networks:
- supervisao
mysql:
image: mysql:latest
container_name: supervisao-db
restart: unless-stopped
tty: true
ports:
- "3306:3306"
volumes:
- ./.docker/mysql:/var/lib/mysql
environment:
MYSQL_DATABASE: supervisao
MYSQL_USER: user
MYSQL_PASSWORD: pass
MYSQL_ROOT_PASSWORD: pass
SERVICES_TAGS: dev
SERVICES_NAME: mysql
networks:
- supervisao
php:
build:
context: .
dockerfile: Dockerfile
container_name: supervisao-php
volumes:
- .:/var/www/html/
- ./.docker/php/docker-xdebug.ini:/usr/local/etc/php/conf.d/php-docker.ini
ports:
- "9000:9000"
networks:
- supervisao
redis:
image: redis:latest
volumes:
- ./.docker/redis:/data
ports:
- 6379:6379
networks:
- supervisao
.ini
# File: docker-xdebug.ini
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so
xdebug.discover_client_host=1
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = host.docker.internal
xdebug.client_port = 9003
xdebug.log = /var/www/html/xdebug.log
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"log": true,
"hostname": "0.0.0.0",
"pathMappings": {
"/var/www/html": "${workspaceFolder}"
},
"port": 9003,
"ignore": [
"**/vendor/**/*.php"
]
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9003
}
]
}
Se alguem já tiver passado pelo mesmo problema e puder ajudar agradeço.