chore: add Keyv package for improved caching and key-value storage

- Added Keyv package (v5.3.1) to package.json for flexible key-value storage
- Updated package-lock.json with Keyv and related dependencies
- Simplified Dockerfile dependency management
- Removed unnecessary buffer and readable-stream package duplicates
This commit is contained in:
Juan Sebastián Montoya 2025-03-10 09:10:17 -05:00
parent 4d4de411f2
commit 18582c1fdc
3 changed files with 496 additions and 406 deletions

View file

@ -7,27 +7,33 @@ COPY . .
# Install dependencies
RUN npm install
# Generate Prisma client
RUN cd apps/api && npm run prisma:generate
# Build the project
RUN cd apps/api && npm run prisma:generate
RUN npx turbo run build --filter=api
# Remove unused files from node_modules
FROM base AS dependencies
WORKDIR /app
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/package-lock.json ./package-lock.json
COPY --from=builder /app/apps/api/package.json ./apps/api/package.json
COPY --from=builder /app/apps/api/prisma ./apps/api/prisma
ARG NODE_ENV=production
RUN npm ci
RUN cd apps/api && npm run prisma:generate
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
COPY --from=builder /app/apps/api/package.json ./apps/api/package.json
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=dependencies /app/package.json ./package.json
COPY --from=dependencies /app/package-lock.json ./package-lock.json
COPY --from=dependencies /app/apps/api/package.json ./apps/api/package.json
COPY --from=builder /app/apps/api/dist ./apps/api/dist
COPY --from=builder /app/apps/api/prisma ./apps/api/prisma
WORKDIR /app/apps/api
EXPOSE 4000
# Start the server
ENTRYPOINT [ "npm", "run", "start:api" ]
ENTRYPOINT [ "npm", "run", "start" ]

View file

@ -28,6 +28,7 @@
"fastify-plugin": "^5.0.0",
"graphql": "^16.10.0",
"jsonwebtoken": "^9.0.2",
"keyv": "^5.3.1",
"mercurius": "^16.1.0",
"mercurius-codegen": "^6.0.1",
"minio": "^8.0.4",

873
package-lock.json generated

File diff suppressed because it is too large Load diff