fix(backend): compiled output was nested under dist/src, not dist/

api container crashed on boot: Cannot find module '/app/dist/main.js'.
Root cause: tsconfig.json had no rootDir, and prisma/make-admin.ts (run
separately via ts-node, never part of the Nest build) was swept into
the nest build compilation since there was no exclude either - so tsc
inferred the output root as the project root and nested everything
under dist/src/ instead of the flat dist/main.js the Dockerfile,
package.json scripts, and compose's worker command all assume.

Also excludes tsconfig.tsbuildinfo from the Docker build context - a
stale local incremental-build cache file was leaking in via `COPY . .`
(only dist/node_modules were dockerignored) and made nest build skip
emitting .js files entirely on a from-scratch container build once the
rootDir fix invalidated its cached signature.
This commit is contained in:
2026-08-11 16:10:44 +02:00
parent 811c14ee73
commit ba409ca53b
3 changed files with 5 additions and 1 deletions
+1
View File
@@ -3,6 +3,7 @@ node_modules/
# Build output # Build output
backend/dist/ backend/dist/
backend/tsconfig.tsbuildinfo
frontend/.next/ frontend/.next/
frontend/tsconfig.tsbuildinfo frontend/tsconfig.tsbuildinfo
+1
View File
@@ -1,5 +1,6 @@
node_modules node_modules
dist dist
tsconfig.tsbuildinfo
.env .env
.env.development .env.development
.env.production .env.production
+3 -1
View File
@@ -9,6 +9,7 @@
"target": "ES2021", "target": "ES2021",
"sourceMap": true, "sourceMap": true,
"outDir": "./dist", "outDir": "./dist",
"rootDir": "./src",
"baseUrl": "./", "baseUrl": "./",
"incremental": true, "incremental": true,
"skipLibCheck": true, "skipLibCheck": true,
@@ -17,5 +18,6 @@
"strictBindCallApply": false, "strictBindCallApply": false,
"forceConsistentCasingInFileNames": false, "forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false "noFallthroughCasesInSwitch": false
} },
"exclude": ["node_modules", "dist", "prisma"]
} }