deprecated and no under maintained.
recommend you to use sparticuz/chromium with playwright.
The simple procedure is documented in the repository playwright-lambda-environment.
based on this blog post
- Selenium required not greater than Python 3.7
- in Python 3.8, Chrome Web Driver returns 127 error
- selenium==3.141.0
- beta-headless-chromium-87.0.4280.27-amazonlinux-2017-03 from serverless-chrome v1.0.0-57
- ChromeDriver 87.0.4280.88 from here
% tree
.
├── Dockerfile
├── README.md
├── app.py
├── bin
│ ├── chromedriver
│ └── headless-chromium
└── headlessdriver.py
1 directory, 6 files
docker build -t image-name .
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
docker run -p 9000:8080 image-name
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"query": "Python"}'
aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin registry.region.amazonaws.com
aws ecr create-repository \
--repository-name image-name \
--image-scanning-configuration scanOnPush=true \
docker tag image-name:latest registry.region1.amazonaws.com/image-name:latest
docker push registry.region.amazonaws.com/image-name:latest
- need 1024MB memory to cold start