Next.js + NestJS + Prisma (MySQL) monorepo replacing the legacy PHP internal app. Includes a session-based auth module with Argon2 password hashing and global input validation (replacing the old app's SQL injection and plaintext password comparison), the full target Prisma schema for customers/insurance/utilities/shared ledger/bank register, Docker Compose + Dockerfiles, and an Access-to-staging migration pipeline (migration/) already run against the real source databases. See PLAN.md and RESUME.md for the full architecture and session history.
25 lines
811 B
Docker
25 lines
811 B
Docker
FROM node:20-alpine AS base
|
|
WORKDIR /repo
|
|
|
|
FROM base AS deps
|
|
COPY package.json package-lock.json* ./
|
|
COPY apps/api/package.json apps/api/package.json
|
|
COPY packages/database/package.json packages/database/package.json
|
|
RUN npm install --workspace=packages/database --workspace=apps/api --no-audit --no-fund
|
|
|
|
FROM deps AS build
|
|
COPY packages/database packages/database
|
|
COPY apps/api apps/api
|
|
RUN npm run generate -w packages/database
|
|
RUN npm run build -w apps/api
|
|
|
|
FROM node:20-alpine AS runtime
|
|
WORKDIR /repo
|
|
ENV NODE_ENV=production
|
|
COPY --from=build /repo/node_modules node_modules
|
|
COPY --from=build /repo/packages/database packages/database
|
|
COPY --from=build /repo/apps/api/dist apps/api/dist
|
|
COPY --from=build /repo/apps/api/package.json apps/api/package.json
|
|
EXPOSE 3001
|
|
CMD ["node", "apps/api/dist/main.js"]
|