Issue created from https://github.com/mnapoli/bref/issues/116#issuecomment-450317578
We are willing to dig in and resolve this if no one else is already working on it. Laravel on Lambda is a particular passion of ours. :-)
@bubba-h57 I think you can go ahead, I am focused on #132 and the documentation at the moment.
Wouldn't it be easiest to just create a directory for all application code? Like 'app' or 'build'. Would also make it easier to use Composer in the bootstrap if required, without colliding with the project Composer vendor dir.
That would work but I think that's too bad :/ (ideally we should keep it simple, deploying in a sub-directory could affect stuff we are not thinking about)
I wonder if we can report that to AWS somehow? The fact that the directory collides with the file is more of a bug I think. If it's a directory it should not be picked up by Lambda.
@pmayet do you see this problem:
or in both?
Maybe it's just a bug in sam local.
What would it affect, you could just change the working dir from the bootstrap? I think it would be easier to change in Bref then convince AWS to change their platform :p
Yes but I guess there will be the same problem in other applications, the fact that the bootstrap directory is attempted to be executed is a bug. But you are right, even if they want to fix it it will take time…
I'm thinking about how all the documentation everywhere mentions that your app runs in /var/task and with Bref it would be a different directory because of this. I think those little complexities might have small impacts in a few places.
In any case what we can do is document this, but since we deploy with SAM (template.yaml + sam deploy) I'm not sure that Bref can help here (at least with how it works now).
@bubba-h57 did you have a solution in mind?
Also how hard is it to rename the bootstrap directory in a fresh Laravel application? Maybe it's worth exploring that too 🤔
That would work but I think that's too bad :/ (ideally we should keep it simple, deploying in a sub-directory could affect stuff we are not thinking about)
I wonder if we can report that to AWS somehow? The fact that the directory collides with the file is more of a bug I think. If it's a directory it should not be picked up by Lambda.
@pmayet do you see this problem:
- on Lambda?
- locally in SAM?
or in both?
Maybe it's just a bug in
sam local.
locally in SAM.
I check with a root directory as indicated by @barryvdh
Change the name of bootstrap directory isn't possible or tricky, because I think hard coded in the framework.
So, locally, create a directory for the application (src by example), and place the the template.yaml at the root directory.
In the template.yaml, specify the directory in the CodeUri
CodeUri: ./src/
I have make a new test with Lumen, no problem with the boostrap directory with Function and the new runtime.
I think you can close this issue @mnapoli .
Oh okay that's perfect!
Most helpful comment
We are willing to dig in and resolve this if no one else is already working on it. Laravel on Lambda is a particular passion of ours. :-)