mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:21:09 +02:00
🐛 fix(mana-search): use pnpm deploy to fix symlink issue in Docker
pnpm creates symlinks in node_modules that point to ../../node_modules/.pnpm/ These symlinks break when only the service node_modules are copied. Using pnpm deploy creates a standalone version with all dependencies copied (no symlinks), which works correctly in Docker. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bc8cd98a27
commit
6548d83e18
1 changed files with 5 additions and 4 deletions
|
|
@ -19,11 +19,13 @@ COPY services/mana-search ./services/mana-search
|
|||
WORKDIR /app/services/mana-search
|
||||
RUN pnpm build
|
||||
|
||||
# Deploy standalone version (resolves pnpm symlinks)
|
||||
RUN pnpm deploy --filter @manacore/mana-search --prod /app/deploy
|
||||
|
||||
# ================================
|
||||
# Production Stage
|
||||
# ================================
|
||||
FROM node:20-alpine AS runner
|
||||
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Create non-root user
|
||||
|
|
@ -33,10 +35,9 @@ USER nestjs
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy built application
|
||||
# Copy deployed standalone application (no symlinks)
|
||||
COPY --from=builder --chown=nestjs:nodejs /app/deploy ./
|
||||
COPY --from=builder --chown=nestjs:nodejs /app/services/mana-search/dist ./dist
|
||||
COPY --from=builder --chown=nestjs:nodejs /app/services/mana-search/node_modules ./node_modules
|
||||
COPY --from=builder --chown=nestjs:nodejs /app/services/mana-search/package.json ./
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3021
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue