There are two parts to this question:
- Running chrome (which electron and, in turn, a nightmare "uses") without a head on linux.
- Install / use xvfb to run chrome on the application engine.
Part 1)
You need xvfb.
Xvfb (Virtual Framebuffer) is just a program that from the wiki: "is a display server that implements the X11 display server protocol. Unlike other display servers, Xvfb performs all the graphic operations in memory without displaying any output to the screen."
This is what you need to start the browser without displaying the screen.
First install all xvfb related packages to run on Linux.
apt-get install -y \ xvfb \ x11-xkb-utils \ xfonts-100dpi \ xfonts-75dpi \ xfonts-scalable \ xfonts-cyrillic \ x11-apps \ clang \ libdbus-1-dev \ libgtk2.0-dev \ libnotify-dev \ libgnome-keyring-dev \ libgconf2-dev \ libasound2-dev \ libcap-dev \ libcups2-dev \ libxtst-dev \ libxss1 \ libnss3-dev \ gcc-multilib \ g++-multilib
So, when installing xvfb, you need to create an xvfb virtual screen and export an environment variable called DISPLAY that points to it. Chromium in Electron will automatically search for $ DISPLAY.
The above can be done more easily. Here are two options:
From now on, you should be able to run a nightmare on Linux.
Part 2)
Nodejs in the application engine runs through a flexible environment. Sense through docker containers.
From the GAE nodejs runtime: βIf your application needs additional dependencies at the operating system level, you will need to use a custom runtime based on this runtime to install the appropriate packages.β
Docker is a whole separate topic, but in order to do this using the application, you have two options, as far as I know:
In any case, basically, you will need to install the packages related to xvfb that define them in the docker file, and this should do the trick.
Good luck
Important notes:
The apt-get packages mentioned above depend on the availability of the Linux distribution (the code above works on ubuntu and debian). For example, with the specified set of packages and during this message it will work with a flexible GAE environment, since it is based on debian jessie and will not work on linux alpine.
Chromium requires a minimal dev / shm distribution to work. For example, 5mb is fixed on the hero, and there is no way to change it. After a few nightmares, chrome will work. Thus, chrome will not work on any of the heroin speakers of any size. The docker is set to 64 MB, so depending on the complexity of your script, you will do whatever you need, or you need to adjust it. On simple Linux installations, dev / shm is usually installed in half the total available memory. Thus, in a 512 MB environment, dev / shm will be set to 256 MB, and the nightmare will most likely work fine.
rickmed
source share