Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image #95

Open
spinnaker1 opened this issue Jul 11, 2019 · 16 comments
Open

Docker image #95

spinnaker1 opened this issue Jul 11, 2019 · 16 comments

Comments

@spinnaker1
Copy link

spinnaker1 commented Jul 11, 2019

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

@danburzo danburzo added the Available This issue is up for grabs label Jul 12, 2019
@danburzo
Copy link
Owner

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.

@Kaitou786
Copy link

Is this still open?

@danburzo
Copy link
Owner

Yes!

@yashha
Copy link
Contributor

yashha commented Nov 16, 2019

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

@Kaitou786
Copy link

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

@yashha
Copy link
Contributor

yashha commented Nov 17, 2019

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

@rywiki
Copy link

rywiki commented Jan 17, 2020

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

@spinnaker1
Copy link
Author

spinnaker1 commented Jan 17, 2020

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/

@illusivedeveloper
Copy link

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

@illusivedeveloper
Copy link

illusivedeveloper commented Jan 20, 2020

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

@spinnaker1
Copy link
Author

spinnaker1 commented Jan 20, 2020

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

@illusivedeveloper
Copy link

illusivedeveloper commented Jan 21, 2020

@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
Copy link

illusivedeveloper commented Jan 21, 2020

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

@spinnaker1
Copy link
Author

@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

@danburzo danburzo changed the title Please create a Docker image! Docker image Jul 25, 2020
@danburzo danburzo added Discussion Documentation and removed Available This issue is up for grabs labels Jul 25, 2020
@XiangRongLin
Copy link
Contributor

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

@danburzo
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants