Skip to content

Commit b1d3fd3

Browse files
tofikwestclaude
andcommitted
fix: portal/app build + Prisma Docker build failures
1. Portal & App: Add @comp/company build to prebuild step so the compiled dist/ exists before next build runs. The package exports compiled JS but wasn't being built during Vercel deployments. 2. API Dockerfile: Bypass prisma.config.ts during db package build. The earlyAccess multi-file schema config conflicts with the --schema=dist/schema.prisma flag on the Linux Prisma engine, causing a panic in the relation walker. Temporarily renaming the config during generate avoids the conflict. 3. API Dockerfile: Update production stage Prisma from 6.13.0 to 6.18.0 to match the version in packages/db/package.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eec6251 commit b1d3fd3

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

apps/api/Dockerfile.multistage

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ COPY apps/api ./apps/api
4444
COPY --from=deps /app/node_modules ./node_modules
4545

4646
# Build workspace packages
47-
RUN cd packages/db && bun run build && cd ../..
47+
# Note: packages/db build bypasses prisma.config.ts to avoid earlyAccess
48+
# multi-file schema conflict with --schema flag on Linux Prisma engine
49+
RUN cd packages/db && \
50+
rm -rf dist && rm -rf ./prisma/generated && \
51+
node scripts/combine-schemas.js && \
52+
mv prisma.config.ts _prisma.config.bak && \
53+
prisma generate --schema=dist/schema.prisma && \
54+
mv _prisma.config.bak prisma.config.ts && \
55+
tsc && \
56+
cd ../..
4857
RUN cd packages/integration-platform && bun run build && cd ../..
4958
RUN cd packages/email && bun run build && cd ../..
5059
RUN cd packages/company && bun run build && cd ../..
@@ -92,7 +101,7 @@ ENV NODE_ENV=production
92101
ENV PORT=3333
93102

94103
# Install Prisma CLI and regenerate client in production stage
95-
RUN npm install -g prisma@6.13.0 && \
104+
RUN npm install -g prisma@6.18.0 && \
96105
prisma generate --schema=./prisma/schema.prisma
97106

98107
# Create non-root user

apps/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
"deploy:trigger-prod": "npx trigger.dev@4.0.6 deploy",
173173
"dev": "bun i && bunx concurrently --kill-others --names \"next,trigger\" --prefix-colors \"yellow,blue\" \"next dev --turbo -p 3000\" \"bunx trigger.dev@4.0.6 dev\"",
174174
"lint": "eslint . && prettier --check .",
175-
"prebuild": "bun run db:generate",
175+
"prebuild": "cd ../../packages/company && bun run build && cd ../../apps/app && bun run db:generate",
176176
"postinstall": "prisma generate --schema=./prisma/schema.prisma || exit 0",
177177
"start": "next start",
178178
"test": "vitest",

apps/portal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"db:migrate": "cd ../../packages/db && bunx prisma migrate dev && cd ../../apps/portal",
5959
"dev": "next dev --turbopack -p 3002",
6060
"lint": "eslint . && prettier --check .",
61-
"prebuild": "bun run db:generate",
61+
"prebuild": "cd ../../packages/company && bun run build && cd ../../apps/portal && bun run db:generate",
6262
"start": "next start"
6363
}
6464
}

0 commit comments

Comments
 (0)