openlabs / docker-wkhtmltopdf-aas

wkhtmltopdf in a docker container as a web service.
BSD 3-Clause "New" or "Revised" License
99 stars 94 forks source link

WKHTMLTOPDF_OPTS and WKHTMLTOPDF_WORKDIR env variable #30

Open lelmarir opened 5 years ago

lelmarir commented 5 years ago

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:

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