Skip to content

Commit

Permalink
PHP: add websockets command
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Aug 21, 2024
1 parent 9e32e81 commit d17c011
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions php-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apk add --no-cache \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-dom \
php${PHP_VERSION}-fileinfo \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-iconv \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-json \
Expand All @@ -30,12 +31,10 @@ RUN apk add --no-cache \
php${PHP_VERSION}-phar \
php${PHP_VERSION}-simplexml \
php${PHP_VERSION}-tokenizer \
php${PHP_VERSION}-tokenizer \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-xmlreader \
php${PHP_VERSION}-xmlwriter \
php${PHP_VERSION}-zip \
php${PHP_VERSION}-gd \
supervisor \
tzdata \
&& ln -sf /usr/bin/php${PHP_VERSION} /usr/bin/php \
Expand Down
1 change: 1 addition & 0 deletions php-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Docker will default to the `serve` command.
- `serve`: starts all services, such as `nginx` and `php-fpm`.
- `scheduler`: process scheduled tasks (cron jobs).
- `queue`: process queued jobs. You can provide a specific queue with `--queue=my_queue`.
- `websockets`: provide pusher websockets service.
- `init`: initialize the project, such as executing migrations.
- `artisan`: helper to execute artisan commands.
- fallback: execute the provided command.
Expand Down
5 changes: 5 additions & 0 deletions php-base/scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ elif [ "$1" = 'queue' ]; then
shift 1;
exec php artisan queue:work --verbose --tries=3 --timeout=60 --rest=0.5 --sleep=3 --max-jobs=1000 --max-time=3600 "$@"

# Helper to run websockets
elif [ "$1" = 'websockets' ]; then
shift 1;
exec php artisan websockets:serve

# Init script, for use in initContainers (for example)
elif [ "$1" = 'init' ]; then
exec php artisan migrate --isolated --no-interaction --force
Expand Down

0 comments on commit d17c011

Please sign in to comment.