Template container for wkhtmltopdf in HTTP server with PHP.
- included
wkhtmltopdf
- Apache (with
mod_expires
,mod_headers
andmod_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.)
Call command docker pull redbitcz/wkpdf
(more info).
This project does not provide finished solution, but only prepared container with configured features – feel free to write your own app inside now.
In your Dockerfile put to FROM
directive redbitcz/wkpdf
.
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
- @boromino for great inspiration how to delete more temporary file from container,
- @ubidots for their right way to extending fonts in linux,
- @elektro-wolle to goot point in discussion about wkhtml's rendering bug.