Skip to content

Latest commit

 

History

History
116 lines (101 loc) · 2.05 KB

README.md

File metadata and controls

116 lines (101 loc) · 2.05 KB

PHP Supervisord

Supervisord (for running job workers)

Please note that the default behavior expects a Laravel app to be mounted within /var/www. You can change this by using a different command then the default command as described below.

Tags

  • latest Latest production release (8.x).
  • php-8.0 Latest 8.0.x release.
  • php-7.4 Latest 7.4.x release.

Options:

  • COMMAND, default setting when not set is: php /var/www/apps/laravel/artisan queue:work --sleep=3 --tries=3 --daemon
  • PROCESSES, default setting when not set is 4

Usage

Quick run:

docker run -d \
  --name taskrunner \
  --mount type=bind,source="$(pwd)"/www,target=/var/www \
  rhessing/php-supervisord

Different amount of processes:

docker run -d \
  --name taskrunner \
  -e PROCESSES=8 \
  --mount type=bind,source="$(pwd)"/www,target=/var/www \
  rhessing/php-supervisord

Different command:

docker run -d \
  --name taskrunner \
  -e COMMAND="php /var/www/app/bin/console messenger:consume async --time-limit=3600"
  --mount type=bind,source="$(pwd)"/app,target=/var/www \
  rhessing/php-supervisord

Different command and amount of processes:

docker run -d \
  --name taskrunner \
  -e PROCESSES=1 \
  -e COMMAND="php /var/www/app/bin/console messenger:consume async --time-limit=3600"
  --mount type=bind,source="$(pwd)"/app,target=/var/www \
  rhessing/php-supervisord

If you want, you can use this image to debug your PHP code:

docker run -it \
  --rm \
  --name taskrunner \
  --mount type=bind,source="$(pwd)"/app,target=/var/www \
  rhessing/php-supervisord /bin/sh

GitHub

Mods

  • bcmath
  • bz2
  • Core
  • ctype
  • curl
  • date
  • dom
  • exif
  • fileinfo
  • filter
  • ftp
  • gd
  • gettext
  • gmp
  • hash
  • iconv
  • intl
  • json
  • libxml
  • mbstring
  • mcrypt
  • mysqli
  • mysqlnd
  • openssl
  • pcre
  • PDO
  • pdo_sqlite
  • Phar
  • posix
  • pspell
  • readline
  • redis
  • Reflection
  • session
  • shmop
  • SimpleXML
  • sodium
  • SPL
  • sqlite3
  • standard
  • tidy
  • tokenizer
  • xml
  • xmlreader
  • xmlwriter
  • zip
  • zlib