The mesh builds all three images from this repository and a commit (novox/hq ADR 0069) — the Drone pipeline that built outside Docker and copied its output in retires with the predecessor. One module carries the API and every client instance: eef and filip are the same built client under two names, which is a second route contribution, not a second module (ADR 0015 — an application is one repository). The clients drop nginx and its bash startup script: the node the API already needs serves the static build too (client-server/serve.mjs — files, the SPA fallback, env-config.js from the environment), so the whole module stands on one declared base. What the machine serves does not move: the same four public names, the same four machine ports. MongoDB, the bucket and every credential arrive as mesh grants instead of hand-set environment; SUPER_ADMIN_KEY stops being a default written in code and becomes a minted secret.
28 lines
1.0 KiB
Docker
Executable File
28 lines
1.0 KiB
Docker
Executable File
# The photos API, built by the mesh from this repository (novox/hq ADR 0069): the build happens
|
|
# here rather than in a CI step that copied its output in — an image the mesh can rebuild from a
|
|
# commit is one whose contents that commit fully determines.
|
|
#
|
|
# The base is named rather than pinned (novox/hq issue 044): declared in module.json's `build.on`,
|
|
# so the copy the mesh holds answers it. One base for both stages — the runtime stage installs
|
|
# production dependencies itself (sharp is a native module rollup cannot bundle), so it needs npm
|
|
# exactly as the build stage does.
|
|
#
|
|
# The build context is the repository root; every COPY says so.
|
|
ARG NODE_BASE
|
|
|
|
FROM ${NODE_BASE} AS build
|
|
WORKDIR /build
|
|
COPY server/package.json server/package-lock.json ./
|
|
RUN npm ci
|
|
COPY server/rollup.config.mjs ./
|
|
COPY server/src ./src
|
|
RUN npm run build
|
|
|
|
FROM ${NODE_BASE}
|
|
ENV NODE_ENV=production
|
|
WORKDIR /app
|
|
COPY server/package.json server/package-lock.json ./
|
|
RUN npm ci --omit=dev
|
|
COPY --from=build /build/dist ./dist
|
|
CMD ["node", "dist/server.cjs", "--enable-source-maps"]
|