From a8d0c117bb762806b44adfe3d64a976890b27f56 Mon Sep 17 00:00:00 2001 From: Giulio Zelante Date: Thu, 4 Jun 2026 21:15:44 +0200 Subject: [PATCH] fix(docker): opt-in INSTALL_OPTIONAL build arg for AGPL extras (#2633) Default image installs requirements.txt only. Set INSTALL_OPTIONAL=true at build time to add requirements-optional.txt (PyMuPDF, markitdown, etc.) without baking AGPL into the standard distributed image. Co-authored-by: Cursor --- Dockerfile | 9 ++++++--- README.md | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 535f0a0..ad273ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,9 +22,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /app -# Install Python deps first (layer cache) -COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +# Install Python deps first (layer cache). Optional extras (PyMuPDF AGPL, etc.) +# are opt-in so the default image stays MIT-core; see requirements-optional.txt. +ARG INSTALL_OPTIONAL=false +COPY requirements.txt requirements-optional.txt ./ +RUN pip install --no-cache-dir -r requirements.txt \ + && if [ "$INSTALL_OPTIONAL" = "true" ]; then pip install --no-cache-dir -r requirements-optional.txt; fi # Copy app code COPY . . diff --git a/README.md b/README.md index d720ec0..638089f 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ cd odysseus cp .env.example .env # optional, but recommended for explicit defaults docker compose up -d --build ``` +To include optional extras in the image (PDF viewer, Office extraction; includes AGPL PyMuPDF), build with `docker compose build --build-arg INSTALL_OPTIONAL=true` before `up`. + Open `http://localhost:7000` when the containers are healthy. Docker Compose binds the web UI to `127.0.0.1` by default. If the port is taken, set `APP_PORT=7001` in `.env` and recreate the container. Set `APP_BIND=0.0.0.0`