From 8a569b3790fe3a72614ffa074db47d1ab10e23d6 Mon Sep 17 00:00:00 2001 From: cloudneutral Date: Sat, 6 Dec 2025 11:50:31 +0800 Subject: [PATCH] Fix dashboard Docker build dependencies (#757) --- dashboard/Dockerfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dashboard/Dockerfile b/dashboard/Dockerfile index a42eccb..2d1b598 100644 --- a/dashboard/Dockerfile +++ b/dashboard/Dockerfile @@ -11,7 +11,7 @@ ARG NODE_RUNTIME_IMAGE=node:22-bookworm-slim # ------------------------------------------------------- FROM ${NODE_BUILDER_IMAGE} AS builder -WORKDIR /app +WORKDIR /app/dashboard ENV NEXT_TELEMETRY_DISABLED=1 # Ensure build tooling (curl via apt) and Yarn (via Corepack) are available @@ -23,24 +23,25 @@ RUN apt-get update \ # Copy entire project COPY . . -# Run Makefile build (must produce .next + node_modules cleaned) -RUN yarn next build +# Install dependencies and build the dashboard +RUN yarn install --frozen-lockfile \ + && yarn next build # ------------------------------------------------------- # Stage 2 — Runtime image (minimal + production deps) # ------------------------------------------------------- FROM ${NODE_RUNTIME_IMAGE} AS runner -WORKDIR /app +WORKDIR /app/dashboard ENV NODE_ENV=production \ RUNTIME_ENV=prod \ REGION=cn # Copy exact runtime artifacts -COPY --from=builder /app/.next ./.next -COPY --from=builder /app/package*.json ./ -COPY --from=builder /app/public ./public -COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/dashboard/.next ./.next +COPY --from=builder /app/dashboard/package*.json ./ +COPY --from=builder /app/dashboard/public ./public +COPY --from=builder /app/dashboard/node_modules ./node_modules EXPOSE 3000