Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

Fix/docker standalone output path (#1562)

Akshat malik02654e773d82
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 79c44f690..8d5de3fde 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -12,12 +12,27 @@ FROM node:20-bookworm-slim AS frontend-builder
WORKDIR /app
-# Install dependencies first (cached layer)
-COPY packages/web/package.json packages/web/package-lock.json* ./
+# Copy root manifest/lockfile for workspace resolution
+COPY package.json package-lock.json* ./
+
+# Copy only workspace package.json manifests first so the npm install layer
+# is cached independently of source changes. Any edit to a .ts/.tsx/etc. file
+# will skip straight to `next build` without re-running the 2-min install.
+COPY packages/web/package.json ./packages/web/package.json
+COPY packages/types/package.json ./packages/types/package.json
+COPY packages/ui/package.json ./packages/ui/package.json
+COPY packages/api-client/package.json ./packages/api-client/package.json
+
+# Change directory to web package and install dependencies
+WORKDIR /app/packages/web
RUN npm install --production=false
-# Copy source and build
-COPY packages/web/ ./
+# Copy full package source (after install — source changes skip the install cache)
+WORKDIR /app
+COPY packages/ ./packages/
+
+# Build Next.js frontend
+WORKDIR /app/packages/web
ENV NEXT_TELEMETRY_DISABLED=1
ENV NEXT_PUBLIC_REPOWISE_API_URL=http://localhost:7337
RUN npm run build
@@ -47,9 +62,9 @@ COPY packages/server/ packages/server/
RUN pip install --no-cache-dir ".[all]"
# Copy built Next.js standalone output
-COPY --from=frontend-builder /app/.next/standalone /app/web
-COPY --from=frontend-builder /app/.next/static /app/web/.next/static
-COPY --from=frontend-builder /app/public /app/web/public
+COPY --from=frontend-builder /app/packages/web/.next/standalone /app/web
+COPY --from=frontend-builder /app/packages/web/.next/static /app/web/packages/web/.next/static
+COPY --from=frontend-builder /app/packages/web/public /app/web/packages/web/public
# Data volume for .repowise directory
# mkdir is required: VOLUME only registers metadata and does not create the
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index d57ce579c..6598026e6 100644
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -16,8 +16,10 @@ uvicorn repowise.server.app:create_app \
--port "${PORT_BACKEND}" &
# Start the Next.js frontend
+# outputFileTracingRoot points to the repo root, so Next.js standalone output
+# nests server.js under packages/web/ relative to the standalone root directory.
echo "Starting repowise Web UI on port ${PORT_FRONTEND}..."
-cd /app/web
+cd /app/web/packages/web
REPOWISE_API_URL="http://localhost:${PORT_BACKEND}" \
HOSTNAME="0.0.0.0" \
PORT="${PORT_FRONTEND}" \
diff --git a/packages/web/next.config.ts b/packages/web/next.config.ts
index a3ecd0d93..c0c3cda4b 100644
--- a/packages/web/next.config.ts
+++ b/packages/web/next.config.ts
@@ -1,7 +1,9 @@
+import path from "path";
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
output: "standalone",
+ outputFileTracingRoot: path.join(__dirname, "../../"),
transpilePackages: ["@repowise-dev/ui", "@repowise-dev/types", "@repowise-dev/api-client"],
experimental: {
optimizePackageImports: ["lucide-react", "recharts"],