Skip to content

ivastly/docker-puphpeteer

Repository files navigation

Rationale

A docker image for Puphpeteer, PHP port of headless Chrome driver puppeteer.

Usage

Hello World - creates a screenshot of a web-page using Puphpeteer

docker-compose build
docker run --rm --interactive --tty --volume $PWD:/app composer install
docker-compose run helloworld php puphpeteer_hello_world.php

Real Project

  • create your own composer.json, but keep requirements from the original one:

    • php 7.2
    • "nesk/puphpeteer": "^1.6"
  • use vastly/puphpeteer as your base docker image

  • Keep in mind mandatory options for puphpeteer's browser object in your own scripts:

$browser   = $puppeteer->launch(
	[
		'args' =>
			[
				// this is required for dockerized puppeteer
				'--no-sandbox',
				'--disable-setuid-sandbox',
				'--disable-dev-shm-usage',
			],
	]
);

LICENSE

See LICENSE file.

About

Fully functional docker image for puphpeteer.

Resources

License

Stars

Watchers

Forks

Packages

No packages published