Skip to content

Dockerized AWS Lambda with headless chromium ready for puppeteer development

Notifications You must be signed in to change notification settings

silvercrow/NodeJS-AWS-Lambda-HeadlessChromium-Puppeteer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS AWS Lambda with Headless Chromium & Puppeteer

Dockerized AWS Lambda with headless chromium ready for puppeteer development

Installation and usage

Build a docker image with docker

docker build -t puppeteer .

Test the lambda container locally

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

Release History

  • 0.0.1
    • Repo Created

About

Dockerized AWS Lambda with headless chromium ready for puppeteer development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published