Base image to be used to create other containers that can be deployed to AWS Ecr and used as lambdas
Scale your scraping and web automations using AWS lambda
You should use this image as a base image to create other images that can be deployed to ecr and used as lambdas.
FROM killdozerx2/lambda-chromium:latest
# Copy your source code and requirements file
COPY . ${LAMBDA_TASK_ROOT}
# Install dependencies
RUN pip install -r requirements.txt
# Set the entrypoint like so
ENTRYPOINT [ "/usr/bin/python", "-m", "awslambdaric" ]
# Set the cmd to run
CMD [ "<path_to_your_lambda_file>.<name_of_the_function>" ]
The path to the chrome binary and webdriver are already available as envrionment variables
CHROME_DRIVER_PATH: Path to chrome webdriverCHROME_BINARY_PATH: Path to chromium binaryEarlier your would run chromium in headless mode using the --headless flag, you don't need that anymore, instead you need to use pyvirtualdisplay.
# Previously
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = webdriver.ChromeOptions()
chrome_option.add_argument("--headless")
chrome_option.add_argument("--disable-gpu")
chrome_option.add_argument("--no-sandbox")
# Now you can simple remove the headless and disable-gpu flag
from selenium import webdriver
from pyvirtualdisplay import Display
display = Display(visible=0, size=(1280, 1696))
display.start()
chrome_options = webdriver.ChromeOptions()
chrome_option.add_argument("--no-sandbox")
Content type
Image
Digest
Size
460 MB
Last updated
over 5 years ago
docker pull killdozerx2/lambda-chromium