Is it possible to share the Dockerfile? #1071
-
Hi @ultrafunkamsterdam - Thank you for the work and we appreciate it! Just a small request, is it possible to share the Dockerfile you used to build the image here. I was trying to build a docker image to run on the AWS lambda but I have tried many different approaches still cannot get it right. I would like to give it a last try and am wondering if you can share the file you used so that we can learn from it. Thanks again! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Please comment if anyone has ran this successfully with Lambda or Docker |
Beta Was this translation helpful? Give feedback.
-
Do you have an example Dockerfile or repo setup with it ?
El El jue, 23 feb 2023 a las 1:47, nathantian ***@***.***>
escribió:
… You can use this
<https://hub.docker.com/r/ultrafunk/undetected-chromedriver> image for
docker if you are running it on ec2. Lambda is slightly more tricky as its
single process, you need to set some chromeoptions to make it work
from tempfile import mkdtemp
def handler(event=None, context=None):
options = uc.ChromeOptions()
options.binary_location = '/opt/chrome/chrome' # make sure you provide the path where you download the chrome
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument("--disable-gpu")
options.add_argument("--window-size=1280x1696")
options.add_argument("--single-process")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--disable-dev-tools")
options.add_argument("--no-zygote")
options.add_argument(f"--user-data-dir={mkdtemp()}")
options.add_argument(f"--data-path={mkdtemp()}")
options.add_argument(f"--disk-cache-dir={mkdtemp()}")
options.add_argument("--remote-debugging-port=9222")
—
Reply to this email directly, view it on GitHub
<#1071 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADDWQ3EUYV2HF5USW2G2UOTWY2XRJANCNFSM6AAAAAAU72JERA>
.
You are receiving this because you commented.Message ID:
<ultrafunkamsterdam/undetected-chromedriver/repo-discussions/1071/comments/5083342
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
Hey hey, |
Beta Was this translation helpful? Give feedback.
You can use this image for docker if you are running it on ec2. Lambda is slightly more tricky as its single process, you need to set some
chromeoptions
to make it work