Dockerized AWS Lambda with headless chromium ready for puppeteer development
Build a docker image with docker
docker build -t puppeteer .
Install the Lambda Runtime Interface Emulator
mkdir -p ~/.aws-lambda-rie && curl -Lo ~/.aws-lambda-rie/aws-lambda-rie \
https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \
&& chmod +x ~/.aws-lambda-rie/aws-lambda-rie
Run docker with the Lambda Runtime Interface Emulator
docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 \
--entrypoint /aws-lambda/aws-lambda-rie \
puppeteer:latest \
/usr/local/bin/npx aws-lambda-ric app.handler
Call the lambda endpoint locally
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
go into the docker container /tmp/ folder and you are going to see the screenshot for google
- 0.0.1
- Repo Created