-
-
Notifications
You must be signed in to change notification settings - Fork 138
feat(core): support frankenphp worker mode #1792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.x
Are you sure you want to change the base?
Conversation
| ])->run(); | ||
| ]; | ||
|
|
||
| if (function_exists('frankenphp_handle_request')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't be enough, as this method exists even when FrankenPHP is running in non-worker mode, and the call below to this method will throw an exception.
This would be a proper check:
| if (function_exists('frankenphp_handle_request')) { | |
| $isWorkerMode = $_SERVER['FRANKENPHP_WORKER'] ?? false; | |
| if ($isWorkerMode && function_exists('frankenphp_handle_request')) { |
|
I'm not sure this is the proper way to do this. The entire point of containerizing Tempest would be that the user don't need PHP on their system at all - so having to invoke the We could just ship with a FROM serversideup/php:8.5-frankenphp
USER root
RUN install-php-extensions intl ftp
USER www-data
WORKDIR /var/www/htmlAnd then have 2 configurations, one in simple mode, one in worker mode: x-volume: &app-volume .:/var/www/html
services:
php:
build: .
container_name: tempest
ports:
- "80:8080"
- "443:8443"
volumes:
- *app-volume
environment:
SSL_MODE: "mixed"x-volume: &app-volume .:/var/www/html
x-worker: &worker-config "worker /var/www/html/public/index.php"
services:
php:
build: .
container_name: tempest
ports:
- "80:8080"
- "443:8443"
volumes:
- *app-volume
environment:
SSL_MODE: "mixed"
FRANKENPHP_CONFIG: *worker-config |
|
I am in agreement with @xHeaven here. This should be a simple Dockerfile that bundles the application and allows a worker mode + non-worker mode. I'm not sure if this should be part of the framework so much as an application scaffold/package that can publish to the application. |
It could be an installable package like Sail for Laravel IMHO. We could also provide our own binary to run things as well (just like Then you could do: ./dockest serve # simple server
./dockest serve --mode=worker # worker mode |
No description provided.