mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 12:29:40 +02:00
- Add NestJS service with Telegraf for Telegram bot functionality - Implement commands: /search, /favorites, /recent, /birthdays, /tags, /stats, /add - Create database schema for user linking and bot settings - Add Contacts API client for fetching contacts data - Include birthday detection and upcoming birthdays list - Add message formatters for German locale - Include Dockerfile and CLAUDE.md documentation - Update TELEGRAM_BOTS.md with new bot Commands implemented: - /search [name] - Search contacts - /favorites - Show favorite contacts - /recent - Recently added contacts - /birthdays - Upcoming birthdays - /tags, /tag [name] - Tag management - /stats - Contact statistics - /add [name] - Quick-add contact - /link, /unlink - Account management https://claude.ai/code/session_01LwmhvhKpEsvVtY1ZKhYu6f
45 lines
1.2 KiB
Docker
45 lines
1.2 KiB
Docker
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install pnpm
|
|
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
|
|
|
# Copy package files
|
|
COPY package.json pnpm-lock.yaml* ./
|
|
COPY services/telegram-contacts-bot/package.json ./services/telegram-contacts-bot/
|
|
|
|
# Install dependencies
|
|
RUN pnpm install --frozen-lockfile --filter @manacore/telegram-contacts-bot
|
|
|
|
# Copy source
|
|
COPY services/telegram-contacts-bot ./services/telegram-contacts-bot
|
|
|
|
# Build
|
|
WORKDIR /app/services/telegram-contacts-bot
|
|
RUN pnpm build
|
|
|
|
# Production image
|
|
FROM node:20-alpine AS runner
|
|
|
|
WORKDIR /app
|
|
|
|
# Install pnpm
|
|
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
|
|
|
# Copy built application
|
|
COPY --from=builder /app/services/telegram-contacts-bot/dist ./dist
|
|
COPY --from=builder /app/services/telegram-contacts-bot/package.json ./
|
|
COPY --from=builder /app/services/telegram-contacts-bot/node_modules ./node_modules
|
|
|
|
# Set environment
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3304
|
|
|
|
EXPOSE 3304
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:3304/health || exit 1
|
|
|
|
CMD ["node", "dist/src/main.js"]
|