-
Notifications
You must be signed in to change notification settings - Fork 416
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
Add Serverless Container Support #723
Add Serverless Container Support #723
Conversation
Thanks for that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks for adding tests & updating the README too.
As it's a new feature, I defined the milestone to 5.5.0.
I'll check for this milestone later if we can add more new features before merging it into master.
I also need to release 5.4.1 first.
Thanks @j0k3r ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be shipped with 5.5.0 🚀
Can you rebase against the master so I'll be able to merge the PR? Thanks 🙏 |
Just updated! Let me know if you need anything else. |
I'm sorry @j0k3r I may be missing something, but how does the files resulting from the webpack bundle get into the container? It seems that you are bundling on one side, and writing the original app.js on the other. |
@flavianh I don't know I've never used it. |
@flavianh I have found a fix for this issue.
|
This worked very well! I spent hours for finding this information... Shouldn't this be included in the documentation? |
@yuto-moriizumi feel free to submit a PR to add it |
What did you implement:
Closes #698
How did you implement it:
I added another function to
validate.js
to get the actual handler name from the function definition, now thatserverless
rolled outimage
for custom runtimes.Review the following documentation: serverless documentation: https://www.serverless.com/blog/container-support-for-lambda. The only gap between feature support defined in the above article and this commit, is the ability to inherit the docker image's default
command
property. For example,serverless-webpack
can't read theCMD
property for the following Dockerfile:However you can simply set the
function.image.command[0]
property inserverless.yml
as an override. I assume this would be the desired approach for most use cases, when sharing a docker image for all functions within the service.How can we verify it:
handler
property, and hasimage.command
instead. Runnpm run test
to quickly validate test coverage:serverless-webpack
and did ayalc publish
to locally mock thenpm
package.npm init npm install npm install webpack serverless-webpack bestzip --dev yalc link serverless-webpack # do a local install of my serverless-webpack branch
plugins
section withserverless-webpack
:command
array to the existingimage
property for the function calledhello
:Note
app.js
contains a function calledhandler
.webpack.config.js
serverless package
serverless deploy
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO