# syntax=docker/dockerfile:1 # Shared Dockerfile for Node.js services (API, worker). Parametrized by # APP_NAME (the workspace package's folder name under apps/) and PORT. # # Not yet size-optimized (copies the whole monorepo incl. devDependencies # into the runtime stage) — deliberate simplification for Fase 1 bootstrap. # Image-size hardening (pnpm deploy / multi-stage prune) is Fase 10 scope, # see docs/implementation-plan.md. FROM node:22-slim AS base RUN corepack enable WORKDIR /repo FROM base AS build COPY . . RUN pnpm install --frozen-lockfile ARG APP_NAME RUN pnpm turbo run build --filter=@eden/${APP_NAME}... FROM node:22-slim AS runtime RUN corepack enable WORKDIR /repo COPY --from=build /repo /repo ENV NODE_ENV=production ARG APP_NAME ENV EDEN_APP_NAME=${APP_NAME} # The API renders PDFs (documents, quote/offer, e-signature certificate) # via a real headless Chromium (packages/integrations/src/pdf/renderer.ts). # Playwright's own installer pulls both the browser binary and the OS # libraries it needs (fonts, libnss, etc.) that node:22-slim doesn't ship. # Skipped for other services (worker) that don't render PDFs, to keep # their image lean — matches this Dockerfile's existing "not yet # size-optimized, simplify for Fase 1" stance above. RUN if [ "$APP_NAME" = "api" ]; then pnpm --filter @eden/integrations exec playwright install --with-deps chromium; fi CMD ["sh", "-c", "pnpm --filter @eden/${EDEN_APP_NAME} start"]