chore: optimize package dependencies and Dockerfile

- Removed duplicate glob package entries in package-lock.json
- Added node-prune to Dockerfile to remove unused node_modules files
- Copied turbo.json to runner stage for improved build consistency
- Simplified Dockerfile dependency management
This commit is contained in:
Juan Sebastián Montoya 2025-03-10 08:09:51 -05:00
parent 057663233d
commit 4d4de411f2
2 changed files with 39 additions and 100 deletions

View file

@ -13,9 +13,14 @@ RUN cd apps/api && npm run prisma:generate
# Build the project
RUN npx turbo run build --filter=api
# Remove unused files from node_modules
RUN wget -O - https://gobinaries.com/tj/node-prune | sh
RUN node-prune /app/node_modules
# Copy the built project
FROM base AS runner
WORKDIR /app
COPY --from=builder /app/turbo.json ./turbo.json
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/package-lock.json ./package-lock.json