Apify

Apify and Crawlee Official Forum

b
F
A
J
A

XVFB fails on server.

I've deployed a playwright with chromium crawler on aws batch, with the default docker image.
this is the error that I'm getting, it's mandatory for this crawler to run headful because otherwise there are some buttons that I need to click that are not loading.
(Error log attached).
I've also tried to create a custom slimmer image, but I bump into the same issue with Xvfb.
N
m
16 comments
, any ideas ?
Hi can you please recommend a solution to this? I am also stuck here πŸ˜… Thanks!
On my side it got fixed … aws batch was overwriting my CMD command from the dockerfile .
That's smooth! Still an issue for me here. If it's not to much to ask, could you please share with me the Dockerfile (at least only the part to get Xvfb running)? Thanks! πŸ™
On what have you based your image ?
apify/actor-node-puppeteer-chrome:latest
Why ? :))
It’s very big and slow
I want all the layers therein. Any recommendations for a slimmer image, with Xvfb and same Apify experience?
Where are you deploying ?
Google Cloud Run
Plain Text
FROM node:lts

RUN apt-get update && \
    apt-get install -y xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable x11-apps chromium && \
    rm -rf /var/lib/apt/lists/*
    
WORKDIR /usr/src/app
COPY package*.json ./
COPY *.tgz ./

RUN npm --quiet set progress=false \
    && npm install --omit=dev --omit=optional \
    && echo "Installed NPM packages:" \
    && (npm list --omit=dev --all || true) \
    && echo "Node.js version:" \
    && node --version \
    && echo "NPM version:" \
    && npm --version

COPY . ./
ENV DISPLAY=:99


CMD xvfb-run -a npm start --silent

I'm also working on an alpine version, but this is much quicker and easier.
you can remove the ENV, and the second copy.
Thanks a lot. That was helpful. Will give it a shot ✨
I'd like to run the official chrome build instead of chromium and install a few other packages too. Anyways, I'll modify the Dockerfile to suit my needs. Thanks!
What is the difference ?
Not much, just some personal preferences πŸ˜…
Add a reply
Sign up and join the conversation on Discord
Join