diff --git a/Dockerfile b/Dockerfile index 8f50791..b646258 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ -FROM python:3.13-slim AS runtime +# Alpine rather than Debian slim purely because of ffmpeg's dependencies. +# Debian's ffmpeg depends on libavdevice, which can render to X11, Wayland and +# OpenGL, so it drags in Mesa and with it LLVM (127 MB) and Z3 (27 MB) to +# encode an MP3 on a headless NAS. Alpine's build brings none of that: 576 MB +# down to 189 MB. +FROM python:3.13-alpine AS runtime ENV PYTHONUNBUFFERED=1 # ffmpeg does the encoding; the application itself has no Python dependencies. -RUN apt-get update \ - && apt-get install --no-install-recommends -y ffmpeg \ - && rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache ffmpeg WORKDIR /app COPY pyproject.toml README.md ./