The command sam local start-lambda
spins up a server inside a Docker container that emulates an AWS Lambda function:
$ sam local start-lambda
Starting the Local Lambda Service. You can now invoke your Lambda Functions defined in your template through the endpoint.
2020-05-29 12:32:13 * Running on http://127.0.0.1:3001/ (Press CTRL+C to quit)
Fetching lambci/lambda:java8 Docker container image......
Mounting /private/var/folders/p_/0lzsyjqd64j3qynmw8sdmf2ws82gz7/T/tmp19t_696o as /var/task:ro,delegated inside runtime container
I wrote a simple Node.js server that hits this endpoint.
Now, i'd like to package both up (i.e. one would run docker start
and both the node.js server & sam local start-lambda
would start running), but i'm not sure how to do this.
Can I write a Dockerfile that somehow links these two endpoints?