How to test a Docker AWS Lambda
locally using docker compose
.
We 'll follow instruction from here, (Optional) Test the image locally
section.
But we 'll use docker compose
and the Compose Watch feature.
Start the container
docker compose up --watch
Invoke the Lambda
curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
Stop the running container
docker compose down
Use docker compose down -v
if you mounted volumes in your compose.yaml
file.
Screen recording preview on youtube