---
head.title: 'Laravel Queue with Docker - Docker PHP - Server Side Up'
description: 'Learn how to configure a Laravel Queue with Docker.'
layout: docs
---

# Laravel Queue with Docker
All you need to do is pass the Laravel Queue command to the container and S6 will automatically monitor it for you.

## Important concepts
1. It's usually best to run the queue as a separate container (but using the same image)
1. Notice we're using the same `my/laravel-app` image for both the PHP and Queue services. This is a common practice to keep the image consistent.
1. You can do cool things with `PHP_FPM_POOL_NAME` to separate the task from the main PHP pool. This is helpful when debugging or monitoring the task.
1. If you need to run the queue in the same container, you might want to look into [writing your own S6 Overlay script](/docs/guide/using-s6-overlay#customizing-the-initialization-process) to manage and monitor multiple processes in one container.

::code-panel
---
label: Task Command
---
```sh
php artisan queue:work --tries=3
```
::

::code-panel
---
label: Example & Simplified Docker Compose File
---
```yaml
version: '3'
services:
  php:
    image: my/laravel-app
    environment:
      PHP_FPM_POOL_NAME: "my-app_php"

  queue:
    image: my/laravel-app
    command: ["php", "/var/www/html/artisan", "queue:work", "--tries=3"]
    environment:
      PHP_FPM_POOL_NAME: "my-app_queue"
```
::