-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Deploy to Vercel (formerly ZEIT, Now) #368
Comments
Thank you for opening this issue with all those details and starting the discussion about Zeit! After looking into this, at this moment this might be a bit early to invest effort into supporting Now as a deployment target (judging by what you mention here and your repositories). First I want to see how much interest there is around this. Just so it is more explicit: supporting Now requires some effort to setup and make it work (and @f3l1x did a lot of that work already), but then it requires effort to maintain it in the long run, as well as documentation, upgrades, fixes, etc. So if you are interested in Now support please add a 👍 on the issue. If you are using Now in production with PHP (with or without Bref) please also post details as a comment, that could be very interesting to understand a bit better what can be done with Now and if it differs from AWS Lambda. |
@mnapoli fyi, ZEIT Now listed as a "Developer Tool Buzz of a Year" -> https://noonies.hackernoon.com/award/cjxws7fcg0h990b06xlcbkxvj So I think this is a proof that Now support is a good decision to make. And a lot of people waiting for more support to php builder, since official php builder not able to deploy project with composer. |
@mnapoli Thanks for your attitude. I like it. For the rest of you. At this time there is a working ZEIT Now build you can play with it. The minimal demo is here. Here is an example: https://now-builders-php-bref-f3l1x.juicyfx1.now.sh/ File: now.json
File: composer.php
File: index.php
Take a look at the examples (https://github.com/juicyfx/now-builders/tree/master/examples) |
This is awesome 🤯, I'll try to deploy a simple Laravel app with Bref to Now this weekend. Thanks @f3l1x! |
Status update. 🙀 I've separated bref deployment to ZEIT into the solo repository - https://github.com/juicyfx/now-bref. I will be happy if you guys can test it. Example phpinfo looks is here - https://now-bref-f3l1x.juicyfx1.now.sh |
Good news before end of 2020. 🎉 I've reworked previous version of Source code: https://github.com/juicyfx/vercel-bref Demo: https://bref.vercel.app/ How to test it? Just simple 4 steps. File: vercel.json
File: composer.php
File: index.php
Deploy: call bref.mp4 |
Hello @mnapoli!
Good job with the whole Bref.sh thing! 👍 I am working at this moment on Bref's integration into the ZEIT Now (https://zeit.co/now). It was really "easy" to provide the working solution.
Web demo: https://now-bref-f3l1x.juicyfx1.now.sh/
Web source: https://github.com/juicyfx/now-bref/tree/master/examples/bref
Builder source: https://github.com/juicyfx/now-bref
I was able to deploy the web with 2 changes, here they come.
1. php-fpm.ini location
In the bootstrap file, there's the line
$phpFpm = new PhpFpm($handler);
.bref/runtime/php/layers/fpm/bootstrap
Line 21 in 8e67dfd
In the Now lambda, the location is quite different. It has all sources in the
/var/task
folder, so the default location of the php-fpm.ini is not/opt/bref/etc/php-fpm.conf
. I must changed it. It's ok, but the the env variable would be more handy.Something like...
2. Missing httpMethod
I'm always getting this exception
The lambda was not invoked via HTTP through API Gateway: this is not supported by this runtime
.bref/src/Runtime/PhpFpm.php
Lines 117 to 119 in 8e67dfd
Somehow the invocation of the lambda is little bit different at Now. I had to change the PhpFpm class or bootstrap, I've chosen change in the bootstrap at this time.
I don't know how to solve it in better way. Maybe you would have some ideas.
That's all, after that changes it works like charm. 🔥
Let me know, if I should prepare some PR or other way.
The text was updated successfully, but these errors were encountered: