mirror of
https://github.com/hanzoai/bootnode.git
synced 2026-09-30 20:46:32 +00:00
The repo could not be built at all. Two independent faults, both from an unpinned toolchain: 1. `corepack enable pnpm` with no `packageManager` field fetched whatever pnpm was newest at build time. pnpm 11 REMOVED `onlyBuiltDependencies` (replaced by `allowBuilds`) and made `strictDepBuilds` default to true, so the sharp allowlist that package.json still carried was silently ignored and install died with ERR_PNPM_IGNORED_BUILDS. pnpm 11 also demotes `.npmrc` to auth/registry only, so settings must live in pnpm-workspace.yaml. Fixed by pinning `packageManager: [email protected].0` and moving the setting to pnpm-workspace.yaml in its current form (`allowBuilds: {sharp: true}`). 2. The `pnpm` field in package.json is dead weight under pnpm 11 — removed rather than left to rot as a second, ignored source of the same setting. Dependencies taken to latest, including four majors: typescript 5.9.3 (NOT 7.0.2 — see below) zod 3 -> 4 recharts 2 -> 3 lucide-react 0.544 -> 1.26 next 16.0.1 -> 16.2.11 react/-dom 19.2.0 -> 19.2.8 @hanzo/iam 0.11 -> 0.13.8 tailwindcss 4.1 -> 4.3.3 @types/node 22 -> 24 (aligned to the runtime, not bumped past it) + every Radix, TanStack and support package TypeScript is deliberately held at 5.9.3, the newest that works. 7.0.2 is the Go-native rewrite with a different package shape; Next 16.2 cannot resolve it and the build fails after compiling, in Next's TypeScript step, with `The "id" argument must be of type string. Received undefined` after it tries to reinstall typescript itself. Revisit when Next declares support. Base image node:22-alpine -> node:24-alpine (Active LTS; 26 is Current, not LTS), digest-pinned so it cannot drift the way pnpm did. pnpm 11 needs Node >= 22 regardless. Verified locally, not assumed: `pnpm install` exits 0, `tsc --noEmit` reports 0 errors across the whole bumped tree, and `pnpm run build` exits 0 with every route prerendered.
78 lines
2.9 KiB
Docker
78 lines
2.9 KiB
Docker
# Bootnode Web Dashboard
|
|
# Next.js 15 with React 19
|
|
|
|
# Pinned digest for supply chain security - update periodically
|
|
# Node 24 = Active LTS. Node 26 is Current, not LTS, so it is not the base for a
|
|
# production image. Digest-pinned so the base cannot move under us the way the
|
|
# unpinned pnpm did. pnpm 11 also requires Node >= 22.
|
|
FROM node:24-alpine@sha256:a0b9bf06e4e6193cf7a0f58816cc935ff8c2a908f81e6f1a95432d679c54fbfd AS base
|
|
|
|
# Install dependencies only when needed
|
|
FROM base AS deps
|
|
RUN apk add --no-cache libc6-compat
|
|
WORKDIR /app
|
|
|
|
# Install dependencies based on the preferred package manager
|
|
# pnpm-workspace.yaml carries the pnpm settings (onlyBuiltDependencies) that
|
|
# pnpm >= 11 no longer reads from package.json. It must land before install or
|
|
# sharp's build script is skipped and the install fails ERR_PNPM_IGNORED_BUILDS.
|
|
# package.json's `packageManager` field pins which pnpm corepack fetches, so the
|
|
# build no longer changes behaviour whenever a new pnpm is published.
|
|
COPY package.json pnpm-lock.yaml* pnpm-workspace.yaml ./
|
|
RUN corepack enable pnpm && pnpm install --frozen-lockfile
|
|
|
|
# Rebuild the source code only when needed
|
|
FROM base AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
# Production build-time environment variables
|
|
# Brand is resolved from the hostname at RUNTIME against the injected brand
|
|
# catalog (lib/brand.ts + /config.json). That is the only white-label mechanism.
|
|
#
|
|
# There are deliberately NO IAM build args. One image serves every white-label
|
|
# host, so a build-time NEXT_PUBLIC_IAM_URL / _CLIENT_ID is one global value
|
|
# shared by all brands — it cannot express per-host white-labeling, and because
|
|
# NEXT_PUBLIC_* is inlined into the client bundle it silently outranks the
|
|
# correct per-brand value with no way to fix it at deploy time. The defaults
|
|
# that used to live here were also both wrong: iam.bootno.de does not serve TLS
|
|
# (525) and bootnode-web is not the registered client, so any rebuild taking
|
|
# the defaults would have broken sign-in outright. Issuer + client_id now come
|
|
# from the brand catalog only.
|
|
ARG NEXT_PUBLIC_BRAND=bootnode
|
|
ARG NEXT_PUBLIC_API_URL=https://api.bootno.de
|
|
ARG NEXT_PUBLIC_WS_URL=wss://ws.bootno.de
|
|
|
|
ENV NEXT_PUBLIC_BRAND=$NEXT_PUBLIC_BRAND
|
|
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
|
ENV NEXT_PUBLIC_WS_URL=$NEXT_PUBLIC_WS_URL
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
RUN corepack enable pnpm && pnpm run build
|
|
|
|
# Production image, copy all the files and run next
|
|
FROM base AS runner
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
RUN adduser --system --uid 1001 nextjs
|
|
|
|
COPY --from=builder /app/public ./public
|
|
|
|
# Automatically leverage output traces to reduce image size
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
|
|
USER nextjs
|
|
|
|
EXPOSE 3001
|
|
|
|
ENV PORT=3001
|
|
ENV HOSTNAME="0.0.0.0"
|
|
|
|
CMD ["node", "server.js"]
|