Baked at image build time: web/Dockerfile takes ARG SUPERBRAIN_VERSION (default dev) into NEXT_PUBLIC_SUPERBRAIN_VERSION; the release workflow passes the tag, README Option B gains the matching --build-arg, and local compose builds show 'dev build'. Rendered muted under the sidebar footer when expanded, so any deployment can be identified from the UI alone.
27 lines
973 B
Docker
27 lines
973 B
Docker
# Pinned patch level for reproducible builds.
|
|
FROM node:22.23.3-alpine3.24 AS deps
|
|
WORKDIR /app
|
|
COPY package.json yarn.lock ./
|
|
RUN yarn install --frozen-lockfile --ignore-scripts
|
|
|
|
FROM node:22.23.3-alpine3.24 AS build
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
# Release version baked into the client bundle (sidebar footer). The release
|
|
# workflow passes the tag as SUPERBRAIN_VERSION; every other build keeps the
|
|
# default and the UI shows "dev build".
|
|
ARG SUPERBRAIN_VERSION=dev
|
|
ENV NEXT_TELEMETRY_DISABLED=1 NEXT_PUBLIC_SUPERBRAIN_VERSION=$SUPERBRAIN_VERSION
|
|
RUN yarn build
|
|
|
|
FROM node:22.23.3-alpine3.24 AS runtime
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 PORT=3000 HOSTNAME=0.0.0.0
|
|
COPY --from=build --chown=node:node /app/.next/standalone ./
|
|
COPY --from=build --chown=node:node /app/.next/static ./.next/static
|
|
COPY --from=build --chown=node:node /app/public ./public
|
|
USER node
|
|
EXPOSE 3000
|
|
CMD ["node", "server.js"]
|