# Multi-stage build for the wordeck-landing Astro surface. # # Build context is the repo root (set in # infrastructure/macmini/docker-compose.landing.yml as `../..`). # # NPM_AUTH_TOKEN is required at build time (BuildKit secret) so pnpm # can fetch @mana/marketing-kit from npm.mana.how (Verdaccio). FROM node:20-alpine AS builder WORKDIR /repo RUN corepack enable && corepack prepare pnpm@9.15.9 --activate # Workspace shell first (cache-friendly). COPY package.json pnpm-workspace.yaml pnpm-lock.yaml .npmrc ./ COPY apps/landing/package.json ./apps/landing/ RUN --mount=type=secret,id=npm_token,env=NPM_AUTH_TOKEN \ pnpm install --filter @wordeck/landing --frozen-lockfile 2>/dev/null \ || pnpm install --filter @wordeck/landing COPY apps/landing ./apps/landing WORKDIR /repo/apps/landing RUN pnpm build FROM nginx:1.27-alpine AS production COPY --from=builder /repo/apps/landing/dist /usr/share/nginx/html COPY apps/landing/infrastructure/nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ CMD wget -qO- http://127.0.0.1/ >/dev/null 2>&1 || exit 1