Skip to content

Latest commit

 

History

History
62 lines (51 loc) · 1.92 KB

README.md

File metadata and controls

62 lines (51 loc) · 1.92 KB

wkhtmltopdf + fonts + PHP as Docker

Template container for wkhtmltopdf in HTTP server with PHP.

Main features

  • included wkhtmltopdf
  • Apache (with mod_expires, mod_headers and mod_rewrite modules)
  • PHP (7.4, 8.0, 8.1)
  • fixed sub-pixel rendering bug (wkhtmltopdf/wkhtmltopdf#3585)
  • installed extended set of fonts (optimized cache incl.)
  • optimized for small image size a fast load
  • ready to run in serverless environment (Google Cloud Run, etc.)

Download image

Call command docker pull redbitcz/wkpdf (more info).

Template philosophy

This project does not provide finished solution, but only prepared container with configured features – feel free to write your own app inside now.

Use for your custom Image

In your Dockerfile put to FROM directive redbitcz/wkpdf.

Usage

In your project create Dockerfile file with content:

FROM redbitcz/wkpdf
COPY . /var/www/html

Build your own image with command:

docker build .

You can also debug it with docker-compose.yml:

version: '3.1'
services:
  web:
    image: redbitcz/wkpdf:debug
    ports:
      - "8080:8080"
    volumes:
      - ".:/var/www/html"
    restart: always
    environment:
      APP_DEBUG: 1
      XDEBUG_CONFIG: "client_host=host.docker.internal"
      PORT: 8080

and then run:

docker compose up

Thanks to