Conversation
| ])->run(); | ||
| ]; | ||
|
|
||
| if (function_exists('frankenphp_handle_request')) { |
There was a problem hiding this comment.
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 |
|
@aidan-casey @xHeaven I'm super open for your feedback here as I'm a total noob in this area. My only goal is to get Tempest properly working with FrankenPHP worker mode, I'm totally fine with whatever approach. The reason I briefly stopped working on this PR is because I ran into framework-specific errors that were impossible to read in worker-mode output. I talked about it with Kevin Dunglas, who suggested writing errors to files and then tail them, but then I ran into not knowing how to do that with a Docker container 😅 Long story short: I could use some help :p |
|
Note: #1834 (comment) |
No description provided.