1# syntax=docker/dockerfile:1 2# AI Software Factory — Web (Next.js 14 App Router) image. 3# NOTE: built as part of the pnpm workspace — the app expects node_modules 4# linked by `pnpm install` at the repo root (monorepo workspace, pnpm >= 9). 5# The @factory/* packages are consumed source-first (transpilePackages), so 6# no per-package build step is required. 7# Usage: docker build -f apps/web/Dockerfile -t factory-web <repo-root> 8FROM node:20-alpine 9 10RUN corepack enable 11 12WORKDIR /repo 13 14# Install workspace dependencies (web + its workspace deps). 15COPY package.json pnpm-workspace.yaml turbo.json tsconfig.json ./ 16COPY apps/web/package.json apps/web/ 17RUN pnpm install --filter @factory/web... --frozen-lockfile=false 18 19# @factory/* workspace packages are consumed from source (transpilePackages) 20# — copy them into the image so the source-first import graph resolves. 21COPY packages packages/ 22 23# App source. 24COPY apps/web apps/web/ 25RUN pnpm --filter @factory/web... build 26 27ENV NODE_ENV=production \ 28 PORT=3000 29 30EXPOSE 3000 31 32CMD ["sh", "-c", "cd apps/web && node_modules/.bin/next start -p 3000"] 33