Install a font in the image

python:3.12-slim ships no font files, so Pillow fell back to its 10-pixel
bitmap font and every printed label came out with sub-millimetre text.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vunz4VLxAYDBnU5tLciLDC
This commit is contained in:
jessikittyandClaude Opus 5 committed 2026-10-13 11:54:04 +11:00
1 parent c8ce4d8117
commit 08284b7d7b
1 file changed
+6
+6
View File
@@ -13,11 +13,17 @@ ENV PYTHONUNBUFFERED=1 \
# libpq for psycopg, and the runtime libs PyMuPDF/Pillow need for # libpq for psycopg, and the runtime libs PyMuPDF/Pillow need for
# PDF thumbnails and image handling. # PDF thumbnails and image handling.
#
# fonts-dejavu-core is not optional: python:3.12-slim ships no font files,
# and without one Pillow silently falls back to a 10-pixel bitmap font.
# Part labels then print letters under a millimetre tall - legible on
# screen, unreadable on the sticker.
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
libpq5 \ libpq5 \
libjpeg62-turbo \ libjpeg62-turbo \
zlib1g \ zlib1g \
libfreetype6 \ libfreetype6 \
fonts-dejavu-core \
curl \ curl \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*