LoginSignup
0
0

【Laravelキュー】Dockerコンテナでのキューワーカー自動起動

Posted at

記事が参考になったが、entry-pointでは動かなかった。

解決

PHPコンテナのコピーコンテナ内でキューワーカーを起動させる

  • volumesが大事。
  • コピーコンテナとPHPコンテナをちゃんと繋げないと、「artisanコマンドが実行できないです」と、怒られてしまう。
docker-compose.yml
#...
services:
    php:
        build:
            context: .
            dockerfile: ./docker/php/Dockerfile
        volumes:
            - ./src:/var/www
        restart: always

    container_worker:
        build:
            context: .
            dockerfile: ./docker/php/Dockerfile
        restart: always
        volumes:
            - ./src:/var/www
        working_dir: /var/www/php-dir
        command: php artisan queue:listen --timeout=1000

#...

参考記事

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0