-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Better documentation around function runtime and Symfony in Docker #1840
Comments
Why not use the console runtime? (https://bref.sh/docs/runtimes/console) |
I did try but because event is an array when data is coming in from SES, this line prevents event data from getting to my handler. bref/src/ConsoleRuntime/Main.php Line 37 in cb264c2
|
Oh sorry I misread that. I think you want to use this feature instead of rebuilding it from scratch: https://github.com/brefphp/symfony-bridge?tab=readme-ov-file#class-handlers |
I looked at this but I couldn't figure out how to invoke that class handler inside my Docker container locally? Only invoking plain PHP file handlers is documented. https://bref.sh/docs/local-development/event-driven-functions#with-docker Also which handler class would I use for SES events? |
Try something like this:
(I think you need to escape the backslashes) For SES there is no specific handler class. You can implement the |
There's no documentation on how to use the docker function runtime to run a Symfony console command. My lambda function is invoked by SES, and I need access to the database, so I had to boot the Kernel.
This was my solution
src/LambdaKernel.php:
bin/lambda-handler.php:
Dockerfile:
The real gotcha was preventing the application from auto exiting, which was putting the application into a loop and running the console command repeatedly.
Maybe it's just a really niche use case, but I was surprised by how difficult it was to deploy a single Symfony console command as a dockerised lambda function (where I don't have to invoke with specific arguments).
The text was updated successfully, but these errors were encountered: