diff --git a/packages/stats/server/Dockerfile b/packages/stats/server/Dockerfile index 13fa2dfad35..01a9004b7bb 100644 --- a/packages/stats/server/Dockerfile +++ b/packages/stats/server/Dockerfile @@ -14,10 +14,12 @@ RUN bunx turbo@2.8.13 prune @opencode-ai/stats-server --docker --no-update-notif FROM base AS installer COPY --from=pruner /app/out/json/ ./ +COPY --from=pruner /app/bun.lock ./bun.lock # Bun 1.3.x needs the pruned workspace globs and lockfile metadata refreshed before the frozen production install. RUN bun -e 'const packageJson = await Bun.file("package.json").json(); packageJson.workspaces.packages = Array.from(new Bun.Glob("packages/**/package.json").scanSync(".")).map((file) => file.slice(0, -"/package.json".length)).sort(); await Bun.write("package.json", JSON.stringify(packageJson, null, 2) + "\n")' -RUN rm -f bun.lock && bun install --filter @opencode-ai/stats-server --lockfile-only --ignore-scripts +# Preserve locked transitive versions while refreshing the pruned workspace metadata. +RUN bun install --filter @opencode-ai/stats-server --lockfile-only --ignore-scripts RUN bun install --filter @opencode-ai/stats-server --frozen-lockfile --production --ignore-scripts FROM base AS runner