From ad1358545603544340d25ddae57f12850b9e87c5 Mon Sep 17 00:00:00 2001 From: alfadb Date: Wed, 10 Jun 2026 16:03:30 +0800 Subject: [PATCH] fix(docker): ship docs/legal in build context for admin-compliance gate LegalDocumentView.vue (admin-compliance acknowledgement gate) build-time imports ../../../../docs/legal/*.md?raw. The Docker image build broke because the frontend-builder stage only COPYs frontend/ (never docs/) and .dockerignore excludes both docs/ and *.md from the build context. Upstream CI runs `pnpm build` from the repo root (docs/ resolvable via ../docs/) and never exercises the Docker path, so this stayed hidden until the buildkit package job surfaced "Could not resolve docs/legal/...md?raw". Fix: - COPY docs/legal/ into /app/docs/legal in Dockerfile and deploy/Dockerfile so it sits beside /app/frontend (WORKDIR), matching the relative import. Only the required subtree is copied to keep the build dependency minimal. - Re-include docs/legal/*.md in .dockerignore so buildkit ships the subtree. --- .dockerignore | 5 +++++ Dockerfile | 7 ++++++- deploy/Dockerfile | 7 ++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 770145cb70..d5369692cb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,6 +11,11 @@ *.md !deploy/DOCKER.md docs/ +# admin-compliance gate (LegalDocumentView.vue) build-time imports +# docs/legal/*.md?raw into the frontend bundle; keep that subtree in the +# Docker build context even though docs/ is otherwise excluded. +!docs/legal/ +!docs/legal/*.md # IDE .idea/ diff --git a/Dockerfile b/Dockerfile index f9a03a2bf3..37b084e7a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,8 +27,13 @@ RUN corepack enable && corepack prepare pnpm@9 --activate COPY frontend/package.json frontend/pnpm-lock.yaml ./ RUN pnpm install --frozen-lockfile -# Copy frontend source and build +# Copy frontend source and build. +# LegalDocumentView.vue (admin-compliance gate) build-time imports +# ../../../../docs/legal/*.md?raw, so docs/legal/ must sit beside frontend/ +# in the image (WORKDIR /app/frontend -> resolves to /app/docs/legal/*.md). +# Copy only that subtree to keep the build dependency minimal. COPY frontend/ ./ +COPY docs/legal/ /app/docs/legal/ RUN pnpm run build # ----------------------------------------------------------------------------- diff --git a/deploy/Dockerfile b/deploy/Dockerfile index d39dd17d5c..6bf0a50b4b 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -26,8 +26,13 @@ RUN corepack enable && corepack prepare pnpm@latest --activate COPY frontend/package.json frontend/pnpm-lock.yaml ./ RUN pnpm install --frozen-lockfile -# Copy frontend source and build +# Copy frontend source and build. +# LegalDocumentView.vue (admin-compliance gate) build-time imports +# ../../../../docs/legal/*.md?raw, so docs/legal/ must sit beside frontend/ +# in the image (WORKDIR /app/frontend -> resolves to /app/docs/legal/*.md). +# Copy only that subtree to keep the build dependency minimal. COPY frontend/ ./ +COPY docs/legal/ /app/docs/legal/ RUN pnpm run build # -----------------------------------------------------------------------------