Skip to content

Commit 545e844

Browse files
VladUZHclaude
andcommitted
fix: restore global prisma install and add explicit schema path
prisma is a devDependency so it's not in production node_modules. Restore global install and explicitly pass schema path to migrate. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c03baaa commit 545e844

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/api/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ WORKDIR /app
5151
RUN addgroup --system --gid 1001 nodejs && \
5252
adduser --system --uid 1001 api
5353

54+
# Install Prisma CLI globally (needed for migrate deploy at startup)
55+
# Must be installed before USER switch since prisma is a devDependency
56+
RUN npm install -g prisma@7
57+
5458
# Copy monorepo structure needed at runtime
5559
COPY --from=build /app/node_modules ./node_modules
5660
COPY --from=build /app/packages/shared/dist ./packages/shared/dist
@@ -70,4 +74,4 @@ HEALTHCHECK --interval=10s --timeout=3s --start-period=30s --retries=3 \
7074
EXPOSE 4000
7175

7276
# Run migrations then start server
73-
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/server.js"]
77+
CMD ["sh", "-c", "prisma migrate deploy --schema=prisma/schema.prisma && node dist/server.js"]

0 commit comments

Comments
 (0)