percollate icon indicating copy to clipboard operation
percollate copied to clipboard

Docker image

Open spinnaker1 opened this issue 5 years ago • 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...

spinnaker1 avatar Jul 11 '19 23:07 spinnaker1

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.

danburzo avatar Jul 12 '19 07:07 danburzo

Is this still open?

Kaitou786 avatar Nov 14 '19 16:11 Kaitou786

Yes!

danburzo avatar Nov 15 '19 06:11 danburzo

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

yashha avatar Nov 16 '19 15:11 yashha

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

Kaitou786 avatar Nov 16 '19 19:11 Kaitou786

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

yashha avatar Nov 17 '19 17:11 yashha

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

rywiki avatar Jan 17 '20 03:01 rywiki

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 avatar Jan 17 '20 16:01 spinnaker1

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

illusivedeveloper avatar Jan 20 '20 03:01 illusivedeveloper

@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.

illusivedeveloper avatar Jan 20 '20 17:01 illusivedeveloper

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. :smile:

spinnaker1 avatar Jan 20 '20 20:01 spinnaker1

@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

illusivedeveloper avatar Jan 21 '20 07:01 illusivedeveloper

@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 avatar Jan 21 '20 10:01 illusivedeveloper

@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

spinnaker1 avatar Jan 21 '20 17:01 spinnaker1

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

XiangRongLin avatar Jan 21 '22 20:01 XiangRongLin

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.

danburzo avatar Jan 24 '22 11:01 danburzo