Open JoshuwayMorris opened 2 months ago
Run the image. If you know you won't need headful browsers, you can remove the XVFB start script for a micro perf gain.
I am not sure if this comment is still valid, it has been there for ages.
If you can't run it without X server, I can imagine there is no much we can do, and you should just leave the CMD
as it was.
cc @vladfrangu
Thanks @B4nan, I thought a similar thing, that if it doesn't run without it, I must need it!
I thought I would post it as an issue in case anyone has a similar problem in the future.
Yeah thanks for letting us know, we'll take a closer look and remove/adjust the comments if its really like that.
Hmm, it seems to be working fine on apify platform even without X server, used a fresh playwright/chrome template (from apify CLI) and only removed that X server part from CMD
. Trying the crawlee template now.
Hmm the crawlee template indeed fails without the X server running, but the apify one works fine.
Packages information
^3.0.0
*
(specified in bothpackage.json
andpackage-lock.json
apify/actor-node-playwright-chrome:20
Application first generated through the Crawlee CLI.
This issue is related to the
apify/actor-node-playwright-chrome
Docker image.Background
Dear team, I've recently been using Crawlee with Playwright and Headless Chrome. I deployed my project as a
Dockerfile
to DigitalOcean's App Platform. I followed the Running in Docker guide on the Crawlee website and copied the example "Browser and TypeScript" Dockerfile.In this example Dockerfile, the following snippet is featured at the end:
I only want to run Crawlee using Playwright and headless Chrome, so I decided to follow the suggestion to remove
the XVFB start script for a micro-perf gain
.However, when I removed this script, Chrome was unable to launch. Crawlee itself does not provide any Chrome-related error information. So, to try and work out what was going wrong, I copied the
chromeTest
script from this repository, and the error message included below was generated:Confusingly, the issue only occurs when deployed to a VPS or DigitalOcean's App Platform. I'm not sure why this would be the case, as I thought the purpose of Docker was to avoid issues like this. If I run the same Docker image/container on my machine, I do not see the error.
For now, I have reinstated the
./start_xvfb_and_run_cmd.sh
script into the final line of my Dockerfile, and the error no longer occurs.Question
I am just wondering, is this a bug? Or if this is expected? As I want to run Chrome in Headless mode, should I need to start XVFB?
Thank you for providing this helpful collection of Docker images.
Error message when not starting XVFB