mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix(passenger-api): ensure Prisma client is properly copied to runtime container
This commit is contained in:
@@ -23,10 +23,10 @@ RUN pnpm turbo build --filter="@edr/passenger-api..."
|
||||
FROM base AS deployer
|
||||
COPY --from=builder /app/ .
|
||||
RUN pnpm deploy --filter="@edr/passenger-api" --legacy /deploy
|
||||
RUN if [ -d node_modules/.prisma ]; then \
|
||||
mkdir -p /deploy/node_modules && \
|
||||
cp -r node_modules/.prisma /deploy/node_modules/.prisma; \
|
||||
fi
|
||||
# Copy Prisma schema and generated client to deployment directory
|
||||
RUN mkdir -p /deploy/node_modules/.prisma /deploy/node_modules/@prisma && \
|
||||
cp -r node_modules/.prisma/client /deploy/node_modules/.prisma/ 2>/dev/null || true && \
|
||||
cp -r node_modules/@prisma/client /deploy/node_modules/@prisma/ 2>/dev/null || true
|
||||
|
||||
# --- Migration image: built in CI, run as a one-shot `docker run --rm --env-file ...`
|
||||
# against the real DB, as its own gated step *before* the app image is built/deployed.
|
||||
@@ -48,7 +48,7 @@ ENV NODE_ENV=production
|
||||
WORKDIR /app
|
||||
RUN addgroup --system --gid 1001 nodejs \
|
||||
&& adduser --system --uid 1001 --ingroup nodejs nestjs
|
||||
COPY --from=deployer --chown=nestjs:nodejs /deploy .
|
||||
COPY --from=deployer --chown=nestjs:nodejs /deploy .\
|
||||
USER nestjs
|
||||
EXPOSE 4000
|
||||
CMD ["node", "dist/main.js"]
|
||||
|
||||
Reference in New Issue
Block a user