This is a docker container that renders a PDF file using a puppeteer instance.
https://hub.docker.com/r/carlosrpj/puppeteer-server-render
Pull the container image from dockerhub:
docker pull carlosrpj/puppeteer-server-render
Run the container exposing port 3000:
docker run --name puppeteer-server-render -p 3000:3000 -d carlosrpj/puppeteer-server-render
First, you will need the docker and docker compose installed.
Execute the follow command to start the container:
docker compose up -d
This container can render a PDF file from a url (GET request) and body data (POST request).
GET /render
- url: [string] The url to be consumed (required).
- filename: [string] The name of generated file without extension (required).
- headers: [object] Http headers to be consumed on the url (autorization, token, etc).
- options: [object] The puppeteer page options.
- download: [true, false] The response would open in new tab, or will download
POST /render
- Content-Type: text/html
- filename: [string] The name of generated file without extension (required).
- options: [object] The puppeteer page options.
- download: [true, false] The response would open in new tab, or will download.
The html to be rendered.
GET /check
This is a health check endpoint, you can define it on your container configurations