feat(infra): dockerised full-stack dev mode — apps compose profile (ADR-0030)
CI / scan (pull_request) Successful in 3m46s
CI / commits (pull_request) Successful in 3m46s
CI / check (pull_request) Successful in 4m4s
CI / a11y (pull_request) Successful in 4m25s
Docs site / build (pull_request) Successful in 4m37s
CI / perf (pull_request) Successful in 8m43s
CI / scan (pull_request) Successful in 3m46s
CI / commits (pull_request) Successful in 3m46s
CI / check (pull_request) Successful in 4m4s
CI / a11y (pull_request) Successful in 4m25s
Docs site / build (pull_request) Successful in 4m37s
CI / perf (pull_request) Successful in 8m43s
Add an 'apps' Compose profile that runs the three Nx dev servers (portal-bff, portal-shell, portal-admin) from a shared Dockerfile.dev, so the whole stack boots with 'dev.sh up apps' and no native Node/pnpm. - Dockerfile.dev: node:24-bookworm + corepack (pnpm from packageManager at runtime), NX_DAEMON=false. No build-time COPY/install. - dev-entrypoint.sh: BFF runs prisma generate + migrate deploy then serves; SPA services go straight to nx serve. - dev.compose.yml: one-shot apps-deps installs into a shared node_modules volume once (apps gate on its completion, no install race); repo bind-mounted, node_modules + .nx in named volumes; BFF reuses its own .env (required:false) with host URLs overridden to Compose service names. - dev.sh: apps added to ALL_PROFILES + usage. - Docs: which-mode-when table (setup doc), apps section (infra README), CLAUDE.md roll-up. ADR-0030 flipped to accepted. Dev-only; production images stay with the ADR-0028 Container Registry work. Additive + profile-gated — native and devcontainer flows unchanged. Full-boot validation pending on a Docker host (see PR body).
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# Dev-only image for the dockerised full-stack dev mode (ADR-0030).
|
||||
#
|
||||
# One image serves all three Nx apps (portal-bff / portal-shell /
|
||||
# portal-admin) — the monorepo means a single install. The image is
|
||||
# intentionally minimal: Node + corepack, nothing copied in. The repo
|
||||
# is bind-mounted at runtime and dependencies install into a named
|
||||
# volume (see dev.compose.yml `apps` profile), so node_modules — with
|
||||
# its native modules built for THIS image — is never shadowed by the
|
||||
# host's.
|
||||
#
|
||||
# NOT a production image. Production artefacts are out of scope per
|
||||
# ADR-0030 and tracked against the ADR-0028 Container Registry work.
|
||||
FROM node:24-bookworm
|
||||
|
||||
# corepack ships with Node 24. Enabling it lets pnpm resolve from the
|
||||
# `packageManager` field in package.json at runtime — no version pinned
|
||||
# here, so this image never drifts from the repo's pinned pnpm.
|
||||
RUN corepack enable
|
||||
|
||||
# Nx + Angular CLI memory ceiling — matches the devcontainer (.devcontainer/
|
||||
# devcontainer.json). 4 GB avoids OOM on large `nx` graph work.
|
||||
ENV NODE_OPTIONS=--max-old-space-size=4096
|
||||
# Nx daemon is per-container and would contend across the three app
|
||||
# containers sharing one workspace bind-mount — disable it. Slight
|
||||
# task-graph cost, robust behaviour.
|
||||
ENV NX_DAEMON=false
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# No COPY / no install at build time: the repo is bind-mounted and the
|
||||
# `apps-deps` one-shot service installs into the node_modules volume on
|
||||
# first boot. Build context stays tiny (just infra/local/) — nothing is
|
||||
# copied. Invoked via `bash` so it does not depend on the bind-mounted
|
||||
# script keeping its executable bit.
|
||||
ENTRYPOINT ["bash", "/workspace/infra/local/dev-entrypoint.sh"]
|
||||
Reference in New Issue
Block a user