From bab031f2414564442ee0ba8cb8502013d177f836 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Wed, 28 Jan 2026 16:41:12 -0500 Subject: [PATCH] feat: Adds pdf support to docker images. --- .gitignore | 2 ++ Sources/EnvClient/Interface.swift | 2 +- Sources/ViewController/Live.swift | 3 ++- docker/Dockerfile | 2 ++ docker/Dockerfile.dev | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d90fff2..bfd357a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ node_modules/ tailwindcss .envrc *.pdf +.env +.env* diff --git a/Sources/EnvClient/Interface.swift b/Sources/EnvClient/Interface.swift index 81d6a7e..b673dfa 100644 --- a/Sources/EnvClient/Interface.swift +++ b/Sources/EnvClient/Interface.swift @@ -32,7 +32,7 @@ public struct EnvVars: Codable, Equatable, Sendable { public let pdfEngine: String public init( - pandocPath: String = "/bin/pandoc", + pandocPath: String = "/usr/bin/pandoc", pdfEngine: String = "weasyprint" ) { self.pandocPath = pandocPath diff --git a/Sources/ViewController/Live.swift b/Sources/ViewController/Live.swift index 767d15d..f9363fc 100644 --- a/Sources/ViewController/Live.swift +++ b/Sources/ViewController/Live.swift @@ -32,7 +32,8 @@ extension ViewController.Request { // // TestPage(trunks: result.trunks, rooms: result.rooms) // } // } - return try! await pdfClient.html(.mock()) + // return try! await pdfClient.html(.mock()) + return EmptyHTML() case .login(let route): switch route { case .index(let next): diff --git a/docker/Dockerfile b/docker/Dockerfile index 071df30..c752c03 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -66,6 +66,8 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \ # libxml2 \ sqlite3 \ curl \ + pandoc \ + weasyprint \ && rm -r /var/lib/apt/lists/* # Create a vapor user and group with /app as its home directory diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index 72dba0b..3953ed6 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -18,6 +18,8 @@ RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \ build-essential \ curl \ wkhtmltopdf \ + pandoc \ + weasyprint \ && rm -r /var/lib/apt/lists/* # Set up a build area