# syntax=docker/dockerfile:1 # # Build + verify @dolphinspired/solid-stage, then isolate exactly the files # `npm publish` needs into a scratch stage the homelab publish plane consumes # (actions/build `artifact-stage: publish-artifacts` -> actions/publish). There # is no runtime image: the final stage is a files-only bundle. FROM node:20-bookworm-slim AS build WORKDIR /app ENV CI=true RUN corepack enable && corepack prepare pnpm@9.15.0 --activate # Install against the workspace graph first, for layer caching: the lockfile, # the workspace manifest, and every package.json - nothing else. COPY pnpm-lock.yaml pnpm-workspace.yaml package.json ./ COPY packages/solid-stage/package.json packages/solid-stage/ COPY playground/package.json playground/ RUN pnpm install --frozen-lockfile # Bring in the sources and build + verify. Fail-closed: a red typecheck or test # fails the image build, so a broken commit never reaches publish/mirror. Build # precedes typecheck because the playground's tsc resolves the library through # its built dist/ types (same ordering as the former CI job). COPY . . RUN pnpm -r --filter './packages/*' run build \ && pnpm -r run typecheck \ && pnpm -r --filter './packages/*' run test # Files-only publish bundle: the package manifest at the root plus everything # package.json `files` publishes (dist, docs, AGENTS.md, README.md, LICENSE, NOTICE). # The docs live at the repo root, so they're copied in here. actions/publish # runs `npm publish` with this exported tree as the package dir. FROM scratch AS publish-artifacts COPY --from=build /app/packages/solid-stage/package.json /package.json COPY --from=build /app/packages/solid-stage/dist /dist COPY --from=build /app/docs /docs COPY --from=build /app/AGENTS.md /AGENTS.md COPY --from=build /app/packages/solid-stage/README.md /README.md COPY --from=build /app/packages/solid-stage/LICENSE /LICENSE COPY --from=build /app/packages/solid-stage/NOTICE /NOTICE