Base Docker image for running Playwright with Python on AWS Lambda with ARM support
2.5K
This repository contains a base Docker image for running Playwright with Python on AWS Lambda with ARM support. The image is optimized for serverless environments and includes all necessary dependencies for headless Chromium browser automation.
Github: lambda-playwright-python
# From DockerHub
docker pull sjw7444/lambda-playwright-python:latest
# From AWS ECR
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/j9p6g6v0/lambda-playwright-python
docker pull public.ecr.aws/j9p6g6v0/lambda-playwright-python:latest
Create a new Dockerfile in your project:
FROM sjw7444/lambda-playwright-python:latest
# Copy your Lambda function code
COPY your_lambda_function.py ${LAMBDA_TASK_ROOT}
# Set the CMD to your handler
CMD [ "your_lambda_function.handler" ]
from playwright.sync_api import sync_playwright
def handler(event, context):
with sync_playwright() as p:
# Launch headless Chromium
browser = p.chromium.launch(headless=True)
page = browser.new_page()
# Your automation code here
page.goto('https://example.com')
title = page.title()
browser.close()
return {'statusCode': 200, 'body': title}
Content type
Image
Digest
sha256:17b175eca…
Size
674.5 MB
Last updated
about 1 month ago
docker pull sjw7444/lambda-playwright-python