danburzo/percollate

Docker image

spinnaker1 opened this issue · 16 comments

Please create a docker image (amd64) of percollate.
This is such an amazing tool.

I spent 3+ days to install nodejs, npm and percollate, puppeteer and chrome headless; still percollate won't work on my system as it gives error messages that chromium wont start or modules not working. Please someone create a docker image, this is an amazing tool that definitely needs a 1-click docker deployment. Please!!! Someone, anyone...

Thanks for the report! I'm sorry to hear you're having trouble setting up the dependencies...
Unfortunately I have zero Docker experience so I wouldn't know how to create an image, but it someone can, that would be great.

Is this still open?

Yes!

I created one for my web api, it should be similar:
https://github.com/yashha/percollate-api/blob/master/Dockerfile

can you tell me the details of what all the things you need inside the docker image

I guess you need google chrome and node and thats enough.
For my web api you also need texlive-extra-utils and start the web server.

Here is a more minimal example:
https://github.com/christopher-talke/node-express-puppeteer-pdf-example/blob/master/Dockerfile

@Kaitou786
sudo docker pull actulance/percollate ,image is about 1.04Gb
and rember run command percollate with '--no-sandbox' option

sudo docker pull actulance/percollate

@rywiki
@illusivedeveloper

Please publish the Dockerfile.

GitHub repository of Docker hub seems to be here: https://github.com/illusivedeveloper/percollate/

@spinnaker1 @rywiki
Sorry, I meant to do this earlier. I will clean up the image with essentials and publish the Dockerfile soon.

@spinnaker1 @danburzo @rywiki I have pushed a new image approx 906 MB size and also published the Dockerfile on the aforementioned GitHub repository. I will make a improved image with the Alpine OS as base later for more reduced image size.

image with the Alpine OS for reduced image size

How about Debian:sid slim or Debian:Jessie ? More people are used to it then Alpine. 😄

@spinnaker1 All debian docker images are larger than ubuntu image. Alpine is the best choice, but it has several dependency issues with chromium launching in headless mode.
Screenshot from 2020-01-21 12-58-02

@spinnaker1 @danburzo @rywiki I have created a new docker image with much reduced size ~445MB :). It can be accessed here: https://hub.docker.com/r/actulance/alpine-percollate
The Github Repository is here: https://github.com/illusivedeveloper/alpine-percollate

I think we can now close #95.

@illusivedeveloper
Thanks, it works.

Have you tried it with an unpriviliged user? Because running percollate and puppeteer with root and --no-sandbox could be dangerous, even if its dockerized. See my failed attempt here, maybe someone can spot the issue.

https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-on-alpine

FROM alpine:edge

RUN apk add --no-cache \
      chromium \
      nss \
      freetype \
      freetype-dev \
      harfbuzz \
      ca-certificates \
      ttf-freefont \
      nodejs \
      npm

RUN addgroup -S user && adduser -S -g user user \
    && mkdir -p /home/user/percollate /app \
    && chown -R user:user /home/user \
    && chown -R user:user /app

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

ADD percollate/ /home/user/percollate/

RUN npm install -g /home/user/percollate --unsafe-perm=true

USER user

I created an updated docker image with an guide on how to run it.
See: https://github.com/NovelService/percollate-docker

I tested it out by starting the container and manually running percollate inside and creating a epub from 2 sites

Thanks, @XiangRongLin! While I'm not in the capacity to evaluate Docker images (zero experience there), I have pointed to this thread from the README to help people looking for Docker images for percollate.