Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

WKHTMLTOPDF_OPTS and WKHTMLTOPDF_WORKDIR env variable#30

Open
lelmarir wants to merge 2 commits into
openlabs:masterfrom
lelmarir:master
Open

WKHTMLTOPDF_OPTS and WKHTMLTOPDF_WORKDIR env variable#30
lelmarir wants to merge 2 commits into
openlabs:masterfrom
lelmarir:master

Conversation

@lelmarir

@lelmarir lelmarir commented Jul 18, 2019

Copy link
Copy Markdown

WKHTMLTOPDF_OPTS env variable allow to add custom options to be applied for all requests,
WKHTMLTOPDF_WORKDIR allow to specify the directory for the html file (/tmp by default). This is usefull if the file references some external files by relative path (eg. fonts) that need to be in the same folder.

other minors:

  • single RUN -> only one layer instead of 2
  • remove tmp file

docker-compose.yml:

wkhtmltopdf-aas:
    image: openlabs/docker-wkhtmltopdf-aas
    build:
      context: .
    volumes:
     - ./static:/static
    environment:
     - WKHTMLTOPDF_OPTS=--disable-local-file-access --allow /static
     - WKHTMLTOPDF_WORKDIR=/static

lelmarir added 2 commits July 18, 2019 12:42
add static options form env and set work directory for wkhtmltopdf
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant