Add PDF generation and printing functionality using Google Chrome

This commit is contained in:
Simon Zeyer
2025-06-09 11:52:44 +00:00
parent 2b331fbd1f
commit 8b4bc74b1d
2 changed files with 81 additions and 19 deletions
+18
View File
@@ -55,6 +55,24 @@ RUN useradd \
print \
&& sed -i '/%sudo[[:space:]]/ s/ALL[[:space:]]*$/NOPASSWD:ALL/' /etc/sudoers
# Print PDF
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
--no-install-recommends \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update && apt-get install -y \
google-chrome-stable \
--no-install-recommends
# It won't run from the root user.
RUN groupadd chrome && useradd -g chrome -s /bin/bash -G audio,video chrome \
&& mkdir -p /home/chrome && chown -R chrome:chrome /home/chrome
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt