docker-nightmare
docker-nightmare copied to clipboard
Nightmare JS Headless image
Docker-Nightmare headless node image
A node:latest compiled with nightmare support running in xvfb.
Usage:
In your project, use this image:
FROM quay.io/ivanvanderbyl/docker-nightmare:latest
ADD . /workspace
RUN yarn install # if you have package.json and/or yarn.lock
CMD "index.js"
Then build the image:
docker build -t myscraper .
Run your nightmare script (assuming it was called index.js):
docker run myscraper:latest --rm index.js
See a working example for DuckDuckGo
Technical details
- Node is latest from docker hub, so probably 7.2+ at time of writing
- Your script is executed with Xvfb running in the background on display
:99.0at1280x2000x24 nodeis executed with--harmony-async-awaitflag.- Most of this is based on help from https://github.com/segmentio/nightmare/issues/224