Git Product home page Git Product logo

Comments (4)

neekolas avatar neekolas commented on August 28, 2024

I can make a PR for something similar to this Dockerfile. It works in my extremely limited testing. Should it go in the examples folder?

https://github.com/neekolas/chromeless-testbed/blob/feature/docker/Dockerfile

from chromeless.

heww avatar heww commented on August 28, 2024

@voltcode https://github.com/joelgriffith/browserless#usage-with-chromeless may works!

from chromeless.

stephanedebove avatar stephanedebove commented on August 28, 2024

I can make a PR for something similar to this Dockerfile. It works in my extremely limited testing. Should it go in the examples folder?

https://github.com/neekolas/chromeless-testbed/blob/feature/docker/Dockerfile

how can this dockerfile work you don't even install chromeless in it?

from chromeless.

stephanedebove avatar stephanedebove commented on August 28, 2024

So after MANY days of searching I'm finally unable to run my Chromeless script in Docker. Here is the dockerfile I use:

FROM ubuntu:16.04
WORKDIR /app
RUN apt-get update
RUN apt-get install curl -y

# Install Node.js
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
RUN apt-get install --yes nodejs wget dos2unix udev ttf-freefont
RUN node -v
RUN npm -v

# install chromeless
COPY package.json /app/package.json
RUN npm install chromeless

#INSTALL CHROME:
RUN \
  wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
  echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
  apt-get update && \
  apt-get install -y google-chrome-stable && \
rm -rf /var/lib/apt/lists/*

Just build this image docker build -t chromeless-image ., and run it with docker run -it -v yourpath:/app chromeless-image /bin/bash, with yourscript.js in yourpath. Then you just need to launch Chrome google-chrome --headless --remote-debugging-port=9222 --disable-gpu --no-sandbox & before launching your chromeless script node yourscript.js and it should be fine.

It's not working 100% though. I have found that when trying to access some websites (which ones exactly I don't know) I run into the errors

[1104/111344.440167:ERROR:bus.cc(394)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[1104/111344.440313:WARNING:property.cc(149)] DaemonVersion: GetAndBlock: failed.
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'

and a bunch of other errors. I have no idea where these errors are coming from.

from chromeless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.