Standard production layout: the OKR app (was nested under AINative_OKR_CASAN5/) is now
the repository root. No more wrapper directory.
- Promote AINative_OKR_CASAN5/* -> repo root (backend/ frontend/ packages/ apps/
.specify/ docs/ infra/ nginx/ scripts/ + configs). Merge tool dirs: .gitea (kept the
active deploy ci.yml, added harness-ci.yml + runbooks), .claude (agents/commands +
launch.json), .github moved up.
- Remove redundant: 00_SUBMISSION_PACKAGE, scattered root notes (FPT_CASAN_Full.md,
tu-tuong-casan.md, casan-tu-sinh..., casan_harness_assessment.md, source-review...,
README_CASAN5_REFINED.md), casan-next-plans/ and optimize-docs/ (competition/planning
artifacts — roadmap + design history preserved in git log / commit messages).
- Update all references to the old layout:
- .gitea/workflows/{ci,harness-ci}.yml, .github/workflows/{ci,deploy}.yml:
working-directory .; drop AINative_OKR_CASAN5/ prefix; .specify/{tests,scripts}
-> packages/casan-harness/... (.specify/logs state kept)
- .claude/launch.json, .gitea/*-runbook.md: path prefixes
- CLAUDE.md, README.md: docs/input -> apps/okr/domain/input
- policy-bundle.yaml: 8 policy paths -> packages/casan-harness/...; manifest re-signed
- secrets-scan.sh: fixture excludes -> new package/domain paths.
Full gate from the new root: PASS=64 FAIL=0 SKIP=3.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
52 lines
1.8 KiB
Docker
52 lines
1.8 KiB
Docker
# ─── Stage 1: Build ──────────────────────────────────────────────────────────
|
|
FROM node:20-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update -qq && apt-get install -y -qq openssl python3 && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY package.json package-lock.json ./
|
|
COPY backend/package.json ./backend/
|
|
COPY frontend/package.json ./frontend/
|
|
COPY backend/prisma ./backend/prisma
|
|
|
|
RUN npm ci
|
|
|
|
COPY backend/src ./backend/src
|
|
COPY backend/tsconfig*.json ./backend/
|
|
|
|
RUN cd backend && npx prisma generate && npx tsc -p tsconfig.build.json
|
|
|
|
# ─── Stage 2: Runtime ────────────────────────────────────────────────────────
|
|
FROM node:20-slim AS runtime
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update -qq && apt-get install -y -qq openssl && rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY package.json package-lock.json ./
|
|
COPY backend/package.json ./backend/
|
|
COPY frontend/package.json ./frontend/
|
|
COPY backend/prisma ./backend/prisma
|
|
|
|
# Reuse the builder's node_modules: it already contains bcrypt's compiled
|
|
# native addon (built WITH install scripts) and the generated Prisma client.
|
|
# A fresh `npm ci --ignore-scripts` here omits bcrypt's *.node binary, so the
|
|
# app crash-loops at runtime ("Cannot find module .../bcrypt_lib.node") — both
|
|
# the seed and NestJS auth require bcrypt. builder and runtime share the same
|
|
# node:20-slim base, so the native binaries are ABI/platform-compatible.
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
COPY --from=builder /app/backend/dist ./backend/dist
|
|
COPY backend/entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
WORKDIR /app/backend
|
|
|
|
EXPOSE 3001
|
|
|
|
ENV PORT=3001
|
|
ENV NODE_ENV=production
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|