From 74e4327a37d5e6fe3a6904e5ec66637d87ad991d Mon Sep 17 00:00:00 2001 From: MarekWo Date: Sun, 12 Apr 2026 21:15:31 +0200 Subject: [PATCH] fix: add build deps for Pillow/pycryptodome on ARM gcc, python3-dev, libjpeg-dev, zlib1g-dev are needed to compile Pillow and pycryptodome from source on linux/arm/v7 (no pre-built wheels available). Build deps are purged after pip install. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e2db88..9032f71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,17 @@ FROM python:3.11-slim -# Install system deps: curl (healthcheck), udev (serial), bluez+dbus (BLE) +# Install runtime + build deps, pip install, then remove build-only packages +# Build deps (gcc, *-dev) needed for Pillow/pycryptodome wheels on ARM RUN apt-get update && apt-get install -y \ curl \ udev \ bluez \ dbus \ + gcc \ + python3-dev \ + libjpeg-dev \ + zlib1g-dev \ && rm -rf /var/lib/apt/lists/* # Set working directory @@ -17,8 +22,11 @@ WORKDIR /app # Copy requirements first for better layer caching COPY requirements.txt . -# Install Python dependencies -RUN pip install --no-cache-dir -r requirements.txt +# Install Python dependencies, then remove build-only packages +RUN pip install --no-cache-dir -r requirements.txt \ + && apt-get purge -y gcc python3-dev libjpeg-dev zlib1g-dev \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* # Copy application code # Note: Run 'python -m app.version freeze' before build to include version info