[b]"Having issues with alpine-node-puppeteer? Anyone got it running smoothly?"[/b] or [b]"Best practices for setti

14 Replies, 486 Views

"Having issues with alpine-node-puppeteer? Anyone got it running smoothly?"

Hey folks,

So I've been banging my head against the wall trying to get alpine-node-puppeteer to work properly. It *seems* like the perfect combo for a lightweight container, but man, the setup is giving me grief.

Chromium keeps failing with missing deps, and the container size balloons up when I start adding fixes. Anyone else wrestled with this?

What’s your go-to setup? Any magic Dockerfile lines or packages I’m missing?

Also, does it even run *well* once it’s working? Or am I better off ditching alpine for a heavier base?

Thanks in advance—y’all are lifesavers!
Man, I feel your pain. alpine-node-puppeteer is a beast to tame. What worked for me was adding these deps in the Dockerfile:

```
RUN apk add --no-cache \
chromium \
nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont
```

Also, set `ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser`. Without this, it kept failing for me. Container size is still decent, but yeah, not as tiny as pure alpine.
Honestly, I gave up on alpine-node-puppeteer after a week of headaches. Switched to `node:16-slim` and it just worked out of the box. Puppeteer installed cleanly, and the container was only slightly bigger.

If you're dead set on alpine, check out this GitHub issue—saved my sanity: [link]. But yeah, sometimes the "lightweight" dream isn't worth the hassle.
Hey! Had the same issue last month. The trick is to use a specific version of chromium that plays nice with alpine. Try:

```
RUN apk add --no-cache chromium~83
```

Older, but stable. Also, make sure you’re using `puppeteer-core` instead of full puppeteer—cuts down on bloat. Works like a charm for my scraping setup.
alpine-node-puppeteer is *possible*, but it’s like assembling IKEA furniture without instructions. Missing libs, weird crashes, ugh.

My advice? Use `docker-slim` to trim down a heavier image post-build. Gets you close to alpine’s size without the setup nightmares. Also, this guide helped me a ton: [link].
OP here—wow, thanks for all the replies! Tried the chromium~83 trick and it *actually* worked. Still tweaking the deps, but it’s running now.

Question though: anyone notice slower performance compared to a debian base? Or is it just me? Might switch to slim if it’s a known thing.

Also, that docker-slim tip is genius—gonna test that next. Y’all rock!
Why not just use the official puppeteer image? It’s heavier, but it’s plug-and-play. alpine-node-puppeteer is cool in theory, but unless you’re *really* strapped for space, it’s not worth the effort.

That said, if you’re committed, this thread has some golden tips: [link].
I got alpine-node-puppeteer running by ditching the default chromium install and using a custom build. Painful, but doable. Here’s my Dockerfile snippet:

```
ENV CHROMIUM_PATH=/usr/bin/chromium-browser
RUN apk add --no-cache \
chromium \
libstdc++
```

Also, don’t forget `--disable-dev-shm-usage` in puppeteer.launch(). Saved me from random crashes.



Users browsing this thread: 1 Guest(s)