mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 15:59:40 +02:00
NestJS notification microservice for email, push, Matrix, and webhook notifications across all ManaCore apps. Features: - Multi-channel delivery (email, push, Matrix, webhook) - Handlebars template engine with defaults - User notification preferences - BullMQ async job processing - Delivery tracking and logging - Prometheus metrics Includes @manacore/notify-client package for NestJS integration.
46 lines
1 KiB
Docker
46 lines
1 KiB
Docker
FROM node:20-alpine AS base
|
|
|
|
# Install pnpm
|
|
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
|
|
|
WORKDIR /app
|
|
|
|
# Build stage
|
|
FROM base AS builder
|
|
|
|
# Copy workspace files
|
|
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./
|
|
COPY services/mana-notify/package.json ./services/mana-notify/
|
|
|
|
# Install dependencies
|
|
RUN pnpm install --frozen-lockfile --filter @manacore/mana-notify
|
|
|
|
# Copy source code
|
|
COPY services/mana-notify ./services/mana-notify
|
|
|
|
# Build
|
|
WORKDIR /app/services/mana-notify
|
|
RUN pnpm build
|
|
|
|
# Production stage
|
|
FROM base AS production
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy built files
|
|
COPY --from=builder /app/services/mana-notify/dist ./dist
|
|
COPY --from=builder /app/services/mana-notify/package.json ./
|
|
|
|
# Copy template files
|
|
COPY --from=builder /app/services/mana-notify/src/templates/defaults ./dist/templates/defaults
|
|
|
|
# Install production dependencies only
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
# Set environment
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3040
|
|
|
|
EXPOSE 3040
|
|
|
|
CMD ["node", "dist/main.js"]
|