A simple service for capturing rendered Web pages using puppeteer.
Part of the Data Fair ecosystem.
Koumoul · La donnée accessible
Koumoul develops the Data Fair ecosystem and hosts it as an online service.
Click here to support the development of this project.
See CONTRIBUTING.md for the dev environment.
Build and run the docker image:
docker buildx build -t capture --progress plain --load . && docker run --rm -it --security-opt seccomp=$(pwd)/seccomp.json -p 5607:5607 -p 9090:9090 -e DEBUG=capture,timer -e ONLY_SAME_HOST=false -e SECRET_CAPTURE=capture -e HELMET_ACTIVE=false -e PORT=5607 --name capture capture
Check the service with these examples (in the dev environment, replace 5607 with DEV_API_PORT from .env):
- simple screenshot
- custom size
- custom lang
- custom timezone
- download with custom filename
- simple pdf print
- simple HTML print
- animated gif screenshot
- animated gif screenshot with custom filename
- fallback to standard screenshot with custom filename
- remote url with a webgl based map
Consider reading this article https://github.com/Zenika/alpine-chrome#3-ways-to-securely-use-chrome-headless-with-this-image
We recommend using ./seccomp.json. If you trust all pages opened by capture you can use PUPPETEER_ARGS=["--no-sandbox"] environment variable.
