title: Run Xdebug on laravel sail docker Windows PhpStorm
body: <p>So, after hours of Googling no right answer is found. Ive started the Laravel 8.x tutorial installation for Windows using Docker and Laravel's sail.</p>
  <p>Now i want to use Xdebug and have absolutely no idea what to do.</p>
  <p>in the root of the project there is a docker-compose.yml (this is the default)</p>
  <pre><code># For more information: https://laravel.com/docs/sail
  version: '3'
  services:
      laravel.test:
          build:
              context: ./vendor/laravel/sail/runtimes/8.0
              dockerfile: Dockerfile
              args:
                  WWWGROUP: '${WWWGROUP}'
          image: sail-8.0/app
          ports:
              - '${APP_PORT:-80}:80'
          environment:
              WWWUSER: '${WWWUSER}'
              LARAVEL_SAIL: 1
              PHP_IDE_CONFIG: 'serverName=localhost'
          volumes:
              - '.:/var/www/html'
          networks:
              - sail
          depends_on:
              - mysql
              - redis
              # - selenium
      # selenium:
      #     image: 'selenium/standalone-chrome'
      #     volumes:
      #         - '/dev/shm:/dev/shm'
      #     networks:
      #         - sail
      #     depends_on:
      #         - laravel.test
      mysql:
          image: 'mysql:8.0'
          ports:
              - '${DB_PORT}:3306'
          environment:
              MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
              MYSQL_DATABASE: '${DB_DATABASE}'
              MYSQL_USER: '${DB_USERNAME}'
              MYSQL_PASSWORD: '${DB_PASSWORD}'
              MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
          volumes:
              - 'sailmysql:/var/lib/mysql'
          networks:
              - sail
      redis:
          image: 'redis:alpine'
          ports:
              - '${REDIS_PORT}:6379'
          volumes:
              - 'sailredis:/data'
          networks:
              - sail
      # memcached:
      #     image: 'memcached:alpine'
      #     ports:
      #         - '11211:11211'
      #     networks:
      #         - sail
      mailhog:
          image: 'mailhog/mailhog:latest'
          ports:
              - 1025:1025
              - 8025:8025
          networks:
              - sail
  networks:
      sail:
          driver: bridge
  volumes:
      sailmysql:
          driver: local
      sailredis:
          driver: local
  
  </code></pre>
  <p>And in the vendor/laravel/sail/runtimes/8.0 folder there is a Dockerfile</p>
  <pre><code>FROM ubuntu:20.04
  
  LABEL maintainer=&quot;Taylor Otwell&quot;
  
  ARG WWWGROUP
  
  WORKDIR /var/www/html
  
  ENV DEBIAN_FRONTEND noninteractive
  ENV TZ=UTC
  
  RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime &amp;&amp; echo $TZ &gt; /etc/timezone
  
  RUN apt-get update \
      &amp;&amp; apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin \
      &amp;&amp; mkdir -p ~/.gnupg \
      &amp;&amp; echo &quot;disable-ipv6&quot; &gt;&gt; ~/.gnupg/dirmngr.conf \
      &amp;&amp; apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C \
      &amp;&amp; apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C \
      &amp;&amp; echo &quot;deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main&quot; &gt; /etc/apt/sources.list.d/ppa_ondrej_php.list \
      &amp;&amp; apt-get update \
      &amp;&amp; apt-get install -y php8.0-cli php8.0-dev \
         php8.0-pgsql php8.0-sqlite3 php8.0-gd \
         php8.0-curl php8.0-memcached \
         php8.0-imap php8.0-mysql php8.0-mbstring \
         php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap \
         php8.0-intl php8.0-readline \
         php8.0-msgpack php8.0-igbinary php8.0-ldap \
         php8.0-redis \
      &amp;&amp; php -r &quot;readfile('http://getcomposer.org/installer');&quot; | php -- --install-dir=/usr/bin/ --filename=composer \
      &amp;&amp; curl -sL https://deb.nodesource.com/setup_15.x | bash - \
      &amp;&amp; apt-get install -y nodejs \
      &amp;&amp; apt-get -y autoremove \
      &amp;&amp; apt-get clean \
      &amp;&amp; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  
  RUN setcap &quot;cap_net_bind_service=+ep&quot; /usr/bin/php8.0
  
  RUN groupadd --force -g $WWWGROUP sail
  RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
  
  COPY start-container /usr/local/bin/start-container
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
  COPY php.ini /etc/php/8.0/cli/conf.d/99-sail.ini
  
  RUN chmod +x /usr/local/bin/start-container
  
  EXPOSE 8000
  
  ENTRYPOINT [&quot;start-container&quot;]
  
  </code></pre>
  <p>now what?
  I'm on a Windows system
  I want to connect it to PhpStorm</p>