From cf7cac6ebb13f85dcd10406c7c41678804f05dd8 Mon Sep 17 00:00:00 2001 From: Richard R Date: Sat, 28 Feb 2026 14:56:49 -0700 Subject: [PATCH] feat: Add SeaweedFS license retrieval and third-party license report generation in Dockerfile --- Dockerfile | 16 ++++++++++++- NOTICE.txt | 66 ------------------------------------------------------ 2 files changed, 15 insertions(+), 67 deletions(-) delete mode 100644 NOTICE.txt diff --git a/Dockerfile b/Dockerfile index e279dce..0ca8145 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,9 @@ RUN git clone --depth 1 https://github.com/ggml-org/whisper.cpp.git && \ # Stage 1b: extract seaweedfs weed binary (for optional embedded weed mini) FROM chrislusf/seaweedfs:latest AS seaweedfs-builder -RUN cp "$(command -v weed)" /tmp/weed +RUN cp "$(command -v weed)" /tmp/weed && \ + (wget -qO /tmp/SeaweedFS-LICENSE.txt "https://raw.githubusercontent.com/seaweedfs/seaweedfs/master/LICENSE" || \ + wget -qO /tmp/SeaweedFS-LICENSE.txt "https://raw.githubusercontent.com/seaweedfs/seaweedfs/main/LICENSE") # Stage 2: build the Next.js app @@ -38,6 +40,14 @@ COPY . . # Build the Next.js application RUN pnpm exec next telemetry disable RUN pnpm build +# Generate third-party dependency license report plus copied license files. +RUN mkdir -p /app/THIRD_PARTY_LICENSES && \ + pnpm dlx license-checker-rseidelsohn@4.3.0 \ + --production \ + --json \ + --relativeLicensePath \ + --out /app/THIRD_PARTY_LICENSES/licenses.json \ + --files /app/THIRD_PARTY_LICENSES/files # Stage 3: minimal runtime image @@ -56,6 +66,10 @@ WORKDIR /app # Copy built app and dependencies from the builder stage COPY --from=app-builder /app ./ +# Include third-party license report and copied license texts at a stable path in the image. +COPY --from=app-builder /app/THIRD_PARTY_LICENSES /licenses +# Include SeaweedFS license text for the copied weed binary. +COPY --from=seaweedfs-builder /tmp/SeaweedFS-LICENSE.txt /licenses/SeaweedFS-LICENSE.txt # Copy the compiled whisper.cpp build output into the runtime image # (includes whisper-cli and its shared libraries, e.g. libwhisper.so, libggml.so) diff --git a/NOTICE.txt b/NOTICE.txt deleted file mode 100644 index 9ce0bfd..0000000 --- a/NOTICE.txt +++ /dev/null @@ -1,66 +0,0 @@ -OpenReader -Third-Party Notices -=================== - -This software is licensed under the MIT License. - -The following third-party software components are included in this project and -are licensed under the Apache License, Version 2.0. Their license and copyright -notices are reproduced below in accordance with the Apache License requirements. - - ------------------------------------------------------------- -pdfjs-dist (PDF.js) ------------------------------------------------------------- - -Copyright 2024 Mozilla Foundation - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - ------------------------------------------------------------- -Dexie.js ------------------------------------------------------------- - -Copyright (c) 2014-2017 David Fahlander - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - ------------------------------------------------------------- -dexie-react-hooks ------------------------------------------------------------- - -Copyright (c) David Fahlander - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file