mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 13:28:11 +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
|
FROM base AS deployer
|
||||||
COPY --from=builder /app/ .
|
COPY --from=builder /app/ .
|
||||||
RUN pnpm deploy --filter="@edr/passenger-api" --legacy /deploy
|
RUN pnpm deploy --filter="@edr/passenger-api" --legacy /deploy
|
||||||
RUN if [ -d node_modules/.prisma ]; then \
|
# Copy Prisma schema and generated client to deployment directory
|
||||||
mkdir -p /deploy/node_modules && \
|
RUN mkdir -p /deploy/node_modules/.prisma /deploy/node_modules/@prisma && \
|
||||||
cp -r node_modules/.prisma /deploy/node_modules/.prisma; \
|
cp -r node_modules/.prisma/client /deploy/node_modules/.prisma/ 2>/dev/null || true && \
|
||||||
fi
|
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 ...`
|
# --- 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.
|
# 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
|
WORKDIR /app
|
||||||
RUN addgroup --system --gid 1001 nodejs \
|
RUN addgroup --system --gid 1001 nodejs \
|
||||||
&& adduser --system --uid 1001 --ingroup nodejs nestjs
|
&& adduser --system --uid 1001 --ingroup nodejs nestjs
|
||||||
COPY --from=deployer --chown=nestjs:nodejs /deploy .
|
COPY --from=deployer --chown=nestjs:nodejs /deploy .\
|
||||||
USER nestjs
|
USER nestjs
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
CMD ["node", "dist/main.js"]
|
CMD ["node", "dist/main.js"]
|
||||||
|
|||||||
Reference in New Issue
Block a user