From 16e68236a03d2b472ac28b6c6194a3115fe45b44 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Tue, 16 Jun 2026 13:13:53 +0300 Subject: [PATCH] build(project): ship the dedup CLI in the runtime image The backend build stage compiled only ./cmd/server, so the dedup maintenance tool was never available on deploy. Build it alongside the server and copy /out/dedup to /app/dedup in the runtime image (which already has ffmpeg/ffprobe for video frames and the /data volume). Run it with `docker exec`. Co-Authored-By: Claude Opus 4.8 --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 14a72c2..cafb391 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,9 @@ COPY backend/ ./ # metadata) and falls back to pure-Go image processing (disintegration/imaging) # when vips is absent, so it stays fully static and portable across base images. RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server +# dedup: offline maintenance CLI for duplicate detection (hash backfill + pairs +# rescan). Shipped alongside the server so it can be run with `docker exec`. +RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/dedup ./cmd/dedup # ----------------------------------------------------------------------------- # Stage 3 — minimal runtime @@ -68,6 +71,8 @@ WORKDIR /app COPY --from=frontend --chown=tanabata:tanabata /src/frontend/build /app/static # The server binary. COPY --from=backend --chown=tanabata:tanabata /out/server /app/server +# The dedup maintenance CLI (run via `docker exec`, not the entrypoint). +COPY --from=backend --chown=tanabata:tanabata /out/dedup /app/dedup # Data directories (overridable via FILES_PATH/THUMBS_CACHE_PATH/IMPORT_PATH). # Created and owned by the tanabata user so a fresh named volume inherits write access.