title: Setup Xdebug configuration for PHP scripts called in cron by docker-entrypoint.sh in VSCode
body: <p>Currently using VSCode on MacOS, Xdebug is working well for my PHP web application ran with docker.</p>
  <p>But I also have some PHP scripts that are called by the <code>docker-entrypoint.sh</code> as crons and I'd like to be able to debug them as well. I can't configure it properly, nothing happens when I set breakpoints while the crons are running.</p>
  <p>Here is my launch.json configuration at the moment (all the codesource - web, scripts...- is under <code>myapp/app</code>) :</p>
  <pre><code>{
      &quot;version&quot;: &quot;0.2.0&quot;,
      &quot;configurations&quot;: [
          {
              &quot;name&quot;: &quot;Listen for Xdebug&quot;,
              &quot;type&quot;: &quot;php&quot;,
              &quot;request&quot;: &quot;launch&quot;,
              &quot;port&quot;: 9001,
              &quot;log&quot;: true,
              &quot;pathMappings&quot;: {
                  &quot;/opt/myapp/app&quot;: &quot;/Users/me/src/myapp/app&quot;
              }
          },
          {
              &quot;name&quot;: &quot;Launch currently open script&quot;,
              &quot;type&quot;: &quot;php&quot;,
              &quot;request&quot;: &quot;launch&quot;,
              &quot;program&quot;: &quot;${file}&quot;,
              &quot;cwd&quot;: &quot;${fileDirname}&quot;,
              &quot;port&quot;: 9002,
              &quot;log&quot;: true
          }
      ]
  }
  </code></pre>
  <p>In my docker-compose.yml, I also have <code>PHP_XDEBUG_ENABLED=true</code> for the web container and the cron container of course.</p>
  <p>Any ideas / configuration examples to get the debug working for the PHP crons ?</p>