...
Codeblock | ||
---|---|---|
| ||
puppeteer: image: registry.brandbox.host/brandbox-product/runtime/puppeteer:latest hostname: $COMPOSE_PROJECT_NAME domainname: local.brandbox.de volumes: - /mnt/nfsstorage/${COMPOSE_PROJECT_NAME}/temp:/var/www/temp/ - /mnt/nfsstorage/${COMPOSE_PROJECT_NAME}/share:/var/www/share/ env_file: - brandbox.docker.env working_dir: /var/www networks: - internal - proxy labels: traefik.enable: "true" traefik.backend.loadbalancer.method: "drr" traefik.docker.network: traefik_webgateway traefik.frontend.rule: "Host:$COMPOSE_PROJECT_NAME-puppeteer.local.brandbox.de" traefik.port: 8080 ports: - "9000" - "3000" expose: - "8080" |
Cluster-Konfiguration (Kubernetes)
Verwendung
Das Image stellt eine einfache Rest-Schnittstelle bereit, mit der HTML-Dokumente an Puppeteer übergeben werden können:
https://service-url/puppeteer?source=SOURCE&target=TARGET
Parameter (GET)
Bezeichnung | Beschreibung |
---|---|
source | Das zu rendernde HTML-Dokument,
|
target | Ein Datei-Pfad für die Ablage des erstellten mehrseitigen Dokuments |
Rückgabewerte (JSON)
Bezeichnung | Beschreibung |
---|---|
result | true für erfolgreiche Konvertierung, false im Fehlerfall |
log | Die Konsolen-Ausgabe von Puppeteer |
Beispiel:
Codeblock |
---|
{
"result": true,
"log": [
"file:///var/www/normal.html",
"file:///var/www/normal.html 200",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/rendered/print-styleguide.css",
"https://brandbox-latest-dh.local.brandbox.de/?request=Fractal/Fractal.image&filename=share/public/client-1/domain-1/Testbilder/16126a.tif",
"https://brandbox-latest-dh.local.brandbox.de/?request=Fractal/Fractal.image&filename=share/public/client-1/domain-1/Testbilder/brandbox_logo.eps",
"https://brandbox-latest-dh.local.brandbox.de/?request=Fractal/Fractal.image&filename=share/public/client-1/domain-1/Testbilder/example.pdf",
"https://brandbox-latest-dh.local.brandbox.de/?request=Fractal/Fractal.image&filename=share/public/client-1/domain-1/Testbilder/konmedia_logo.eps",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-document.js",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/rendered/print-styleguide.css 200",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-document.js 200",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/fonts/roboto-normal-400.woff2",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/fonts/roboto-normal-700.woff2",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-element.js",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/fonts/roboto-normal-400.woff2 200",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/fonts/roboto-normal-700.woff2 200",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-element.js 200",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-table.js",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-table.js 200",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-paragraph.js",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-paragraph.js 200",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-page.js",
"https://brandbox-latest-dh.local.brandbox.de/temp/public/framework/fractal/js/print-page.js 200",
"Created 1 pages",
"https://brandbox-latest-dh.local.brandbox.de/?request=Fractal/Fractal.image&filename=share/public/client-1/domain-1/Testbilder/konmedia_logo.eps 200",
"Created 2 pages",
"https://brandbox-latest-dh.local.brandbox.de/?request=Fractal/Fractal.image&filename=share/public/client-1/domain-1/Testbilder/brandbox_logo.eps 200",
"https://brandbox-latest-dh.local.brandbox.de/?request=Fractal/Fractal.image&filename=share/public/client-1/domain-1/Testbilder/16126a.tif 200",
"https://brandbox-latest-dh.local.brandbox.de/?request=Fractal/Fractal.image&filename=share/public/client-1/domain-1/Testbilder/example.pdf 200",
"Created 3 pages",
"Created 4 pages",
"Created 5 pages",
"Created 6 pages",
"Created 7 pages",
"Created 8 pages",
"Created 9 pages",
"Created 10 pages",
"Created 11 pages",
"Document processing took 3.323 seconds",
"Finished in 3.558 seconds (11 pages)"
]
} |