Skip to content
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

Standalone binary works - but how to bundle octane #605

Closed
kevincobain2000 opened this issue Feb 27, 2024 · 6 comments · Fixed by #753
Closed

Standalone binary works - but how to bundle octane #605

kevincobain2000 opened this issue Feb 27, 2024 · 6 comments · Fixed by #753
Labels
enhancement New feature or request

Comments

@kevincobain2000
Copy link
Contributor

kevincobain2000 commented Feb 27, 2024

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.

@kevincobain2000 kevincobain2000 added the enhancement New feature or request label Feb 27, 2024
@sneycampos
Copy link
Contributor

@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

@skmirajbn
Copy link

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.

@dunglas
Copy link
Owner

dunglas commented Apr 27, 2024

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.

@skmirajbn
Copy link

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.

@dunglas
Copy link
Owner

dunglas commented Apr 29, 2024

@skmirajbn I added a section about this: #753

@thienvu18
Copy link

Hello @dunglas @skmirajbn, where to put the .env file for the bundled app? Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants