diff --git a/Dockerfile.api b/Dockerfile.api index 21a2667..73911ec 100644 --- a/Dockerfile.api +++ b/Dockerfile.api @@ -43,6 +43,9 @@ RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \ FROM deps AS build COPY packages/shared ./packages/shared COPY apps/api ./apps/api +# Inclus les PDFs de démo pour le command `seed:demo` (lancé manuellement +# en prod via `kubectl exec`). 27 fichiers, ~80KB total — négligeable. +COPY assets ./assets RUN cd apps/api && pnpm exec tsx ace.js build --ignore-ts-errors # Prune devDeps (les workspace symlinks restent). diff --git a/apps/api/database/factories.ts b/apps/api/database/factories.ts index 90ae5aa..7a609fd 100644 --- a/apps/api/database/factories.ts +++ b/apps/api/database/factories.ts @@ -414,12 +414,15 @@ async function seedSyntheticActionable( // --------------------------------------------------------------------------- /** - * Localise le dossier `assets/test-invoices` à la racine du repo. Le command - * tourne depuis `apps/api/`, donc on remonte de 2 niveaux. + * Localise le dossier `assets/test-invoices`. La résolution couvre 3 contextes : + * - dev local : cwd = `apps/api/` → `../../assets/test-invoices` + * - prod (init) : cwd = `/app/apps/api` → `../../assets/test-invoices` + * - prod (build) : cwd = `/app/apps/api/build` → `../../../assets/test-invoices` */ function resolveTestInvoicesDir(): string | null { const candidates = [ join(process.cwd(), '..', '..', 'assets', 'test-invoices'), + join(process.cwd(), '..', '..', '..', 'assets', 'test-invoices'), join(process.cwd(), 'assets', 'test-invoices'), ] for (const c of candidates) {