Skip to content
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: minimal

services:
- docker

install:
- ./sh/build.sh

script:
- docker run --shm-size 1G --rm -v `pwd`/examples/minimal.js:/app/index.js alekzonder/puppeteer:latest
15 changes: 15 additions & 0 deletions examples/minimal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const puppeteer = require('puppeteer');

(async() => {

const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
const page = await browser.newPage();
await page.goto('https://www.google.com/', { waitUntil: 'networkidle2' });

// Print first 1000 characters of DOM content
console.log((await page.content()).substring(0, 1000));
await browser.close();

})();
2 changes: 2 additions & 0 deletions sh/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
set -e

docker build -t alekzonder/puppeteer:latest .
docker images