frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

Standalone binary works - but how to bundle octane

Open kevincobain2000 opened this issue 1 year ago • 1 comments

Describe you feature request

Standalone binary works well and works out of the box. Nice!

However, in order to run the binary on Octane, I am doing like below:

./my-app-binary php-cli artisan octane:start --port=3008 --admin-port=8000 --workers=32 --max-requests=10000 

If I just run as php-server, then it runs on FrankenServer, and not FrankenAPI. There is a huge performance difference between these two and want to be able to run the binary on FrankenAPI.

./my-app-binary php-server --listen=3008

I think I am missing something? A worker file --worker= to be passed to run to get the boosted performance. By providing worker path, it throws ERROR same as https://github.com/dunglas/frankenphp/issues/318

2024/02/27 10:59:15.032	ERROR	unexpected termination, restarting	{"worker": "/Users/pulkit.kathuria/git/laravel-10/public/frankenphp-worker.php", "exit_status": 255}

Anyways, my question (or feature request) is to have docs on creating standalone binary with samples of workers files.

kevincobain2000 avatar Feb 27 '24 11:02 kevincobain2000

@kevincobain2000 could you share the Dockerfile used in this process? did you embed your application and frankenphp? if you created a binary probably your worker script path is not these

sneycampos avatar Mar 14 '24 13:03 sneycampos

Describe you feature request

Standalone binary works well and works out of the box. Nice!

However, in order to run the binary on Octane, I am doing like below:

./my-app-binary php-cli artisan octane:start --port=3008 --admin-port=8000 --workers=32 --max-requests=10000 

If I just run as php-server, then it runs on FrankenServer, and not FrankenAPI. There is a huge performance difference between these two and want to be able to run the binary on FrankenAPI.

./my-app-binary php-server --listen=3008

I think I am missing something? A worker file --worker= to be passed to run to get the boosted performance. By providing worker path, it throws ERROR same as #318

2024/02/27 10:59:15.032	ERROR	unexpected termination, restarting	{"worker": "/Users/pulkit.kathuria/git/laravel-10/public/frankenphp-worker.php", "exit_status": 255}

Anyways, my question (or feature request) is to have docs on creating standalone binary with samples of workers files.

Hello How did you connect database when using Laravel application as Standalone binary? I can't get connected to database. The database is on same machine localhost.

skmirajbn avatar Apr 24 '24 19:04 skmirajbn

I'm writing a guide explaining how to bundle Laravel and Octane apps: https://github.com/dunglas/frankenphp/pull/753

Does it help?

For the database, set the corresponding environment variables or change your .env file (don't forget to run artisan optimize:clear and artisan optimize after.

dunglas avatar Apr 27 '24 19:04 dunglas

I'm writing a guide explaining how to bundle Laravel and Octane apps: #753

Does it help?

For the database, set the corresponding environment variables or change your .env file (don't forget to run artisan optimize:clear and artisan optimize after.

The database connection is now established. However, it appears that images uploaded within the application, like those stored in the public folder, aren't retained in the application. I did build self contained binary.

skmirajbn avatar Apr 27 '24 19:04 skmirajbn

@skmirajbn I added a section about this: https://github.com/dunglas/frankenphp/pull/753

dunglas avatar Apr 29 '24 14:04 dunglas