Code Monkey home page Code Monkey logo

docker-html-pdf-chrome's Introduction

docker-html-pdf-chrome

github-actions github-release docker-image-size

Dockerized html-pdf-chrome, with headless chromium running in the background.

Tags

Tag Dockerfile Build Context
:0.8.4, :latest View
  • All images are based on alpine, and include node and npm

Usage

To export a remote HTML page as .pdf:

docker run --rm -it -e URL=http://localhost -e PDF_FILE=export.pdf -v $(pwd):$(pwd) -w $(pwd) --network host theohbrothers/docker-html-pdf-chrome:0.8.4
docker run --rm -it -e URL=https://example.com -e PDF_FILE=export.pdf -v $(pwd):$(pwd) -w $(pwd) theohbrothers/docker-html-pdf-chrome:0.8.4

For export more complex cases, mount your custom script as /export.js:

docker run --rm -it -v $(pwd)/export.js:/export.js -v $(pwd):$(pwd) -w $(pwd) theohbrothers/docker-html-pdf-chrome:0.8.4 node /export.js

For a sleeping container (to reduce overhead of restarting chromium every run):

docker run --rm -it -e SLEEP=1 -v $(pwd):$(pwd) -w $(pwd) theohbrothers/docker-html-pdf-chrome:0.8.4

See html-pdf-chrome usage.

Development

Requires Windows powershell or pwsh.

# Install Generate-DockerImageVariants module: https://github.com/theohbrothers/Generate-DockerImageVariants
Install-Module -Name Generate-DockerImageVariants -Repository PSGallery -Scope CurrentUser -Force -Verbose

# Edit ./generate templates

# Generate the variants
Generate-DockerImageVariants .

Variant versions

versions.json contains a list of Semver versions, one per line.

To update versions in versions.json:

./Update-Versions.ps1

To update versions in versions.json, and open a PR for each changed version, and merge successful PRs one after another (to prevent merge conflicts), and finally create a tagged release and close milestone:

$env:GITHUB_TOKEN = 'xxx'
./Update-Versions.ps1 -PR -AutoMergeQueue -AutoRelease

To perform a dry run, use -WhatIf.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.