title: Laradock php-worker is not working for artisan queue:work
body: <p>I am deploying a Laravel 7.28.3 app with Laradock on production mode.</p>
  <p>So far the application is working in its domain.com with Let's Encrypt.</p>
  <p>Since I am using the Email Verification feature, I want the <code>php artisan queue:work</code>running in the background. According to <a href="https://laradock.io/documentation/#run-laravel-queue-worker" rel="nofollow noreferrer">the docs</a>, you can use the <code>php-worker</code> container.</p>
  <p>So I set up all according to them, but the <code>php-worker</code> is not dispatching the queued jobs.</p>
  <p>In the .env the queue connection driver is <code>database</code>:</p>
  <pre><code>QUEUE_CONNECTION=database
  </code></pre>
  <p>The configuration files are as follows:</p>
  <p><strong><code>laravel-worker.conf</code></strong> inside the <code>php-worker/supervisord.d/</code> directory:</p>
  <pre><code>[program:laravel-worker]
  process_name=%(program_name)s_%(process_num)02d
  command=php /var/www/artisan queue:work --sleep=3 --tries=3 --daemon
  autostart=true
  autorestart=true
  numprocs=8
  user=root
  redirect_stderr=true
  </code></pre>
  <p>In this case, I'm only running the <code>nginx</code>, <code>mysql</code> and <code>php-worker</code> containers. The docs say the <code>workspace</code> container is run automatically. So:</p>
  <pre><code>$ sudo docker-compose -f docker-compose.production.yml up --build nginx mysql php-worker
  </code></pre>
  <p>When scanning the realtime logs I get the following messages:</p>
  <pre><code>php-worker_1           | 2020-08-11 03:13:48,889 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
  php-worker_1           | 2020-08-11 03:13:48,889 INFO Included extra file &quot;/etc/supervisord.d/laravel-worker.conf&quot; during parsing
  php-worker_1           | 2020-08-11 03:13:48,895 INFO RPC interface 'supervisor' initialized
  php-worker_1           | 2020-08-11 03:13:48,895 CRIT Server 'inet_http_server' running without any HTTP authentication checking
  php-worker_1           | 2020-08-11 03:13:48,895 INFO supervisord started with pid 1
  ...
  php-worker_1           | 2020-08-11 03:13:49,938 INFO spawned: 'laravel-worker_07' with pid 14
  php-worker_1           | 2020-08-11 03:13:50,939 INFO success: laravel-worker_00 entered RUNNING state, process has stayed up for &gt; than 1 seconds (startsecs)
  php-worker_1           | 2020-08-11 03:13:50,939 INFO success: laravel-worker_01 entered RUNNING state, process has stayed up for &gt; than 1 seconds (startsecs)
  </code></pre>
  <p>Then I test the application by creating a new account (at /register), there's nothing reported at the logs by the <code>php-worker</code>.</p>
  <p><strong>Hmmm... now it's working!</strong></p>
  <p><a href="https://dev.to/dendihandian/php-worker-in-laradock-2e4j" rel="nofollow noreferrer">Reference</a>.</p>