Error de conexion Xdebug

Error Xdebug

Xdebug 3 couldn't connect from Docker [20.10.12] to PhpStorm debug client. Ubuntu

Dockerfile

FROM php:8.1-apache as php_base
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN a2enmod rewrite && install-php-extensions pgsql
RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf && service apache2 restart
WORKDIR /var/www/lessor-calculator

FROM php_base as php_dev
RUN pecl install xdebug && docker-php-ext-enable xdebug

docker-compose.yml:

version: "3.4"

services:
  app:
    build:
      context: docker/server
      target: php_dev
    networks:
      my-network:
    environment:
      PHP_IDE_CONFIG: "serverName=MyApp"
    ports:
      - "${DOCKER_SERVER_PORT:-9180}:80"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - ./:/var/www/lessor-calculator
      - ./docker/server/apache/sites-enabled:/etc/apache2/sites-enabled
      - ./docker/server/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
      - ./docker/server/php/conf.d/xdebug.log:/var/log/xdebug.log
      - ./docker/server/php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini
  1. xdebug_info() output:
  2. UPDATE: Xdebug conf:
zend_extension=xdebug

[xdebug]
xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=yes
xdebug.log="/var/log/xdebug.log"

https://stackoverflow.com/questions/70577709/xdebug-3-couldnt-connect-from-docker-20-10-12-to-phpstorm-debug-client-ubunt