Laravel

Queue

Run Laravel queue workers as their own containers with php artisan queue:work. Each worker uses the same image as your web service, so you scale queues by adding containers without touching the web server.

Spin Pro sets up Laravel queue workers on your own server with zero-downtime deployments.

Compose example

compose.yml
services:
  app:
    image: my-org/my-app:1.0.0
    ports:
      - "80:8080"

  queue:
    image: my-org/my-app:1.0.0
    command: ["php", "artisan", "queue:work", "--tries=3"]
    stop_signal: SIGTERM
    healthcheck:
      test: ["CMD", "healthcheck-queue"]
      start_period: 10s

stop_signal and the health check are required on every worker. Running workers explains why.

Worker options

Pass queue:work options in the command, such as --tries, --timeout, or --queue=high,default. To run more workers, raise the replica count (docker compose up --scale queue=3) or add another service with a different --queue.

If a job can run longer than 10 seconds, set stop_grace_period above your longest job so a deploy doesn't kill it halfway.

Use queue:work, not queue:listen

healthcheck-queue looks for a process named queue:work. queue:listen keeps restarting short-lived queue:work processes, so the health check fails intermittently. queue:listen also boots the framework for every job, so it's slower in production.

Using Redis queues with a dashboard? Run Horizon instead of queue:work, not both.