mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-27 11:17:42 +02:00
feat(matrix-nutriphi-bot): add Matrix bot for nutrition tracking
- NestJS bot with matrix-bot-sdk integration - Commands: !help, !login, !analyze, !today, !week, !goals, !favorites, !tips - Integrates with NutriPhi backend API (port 3023) - User session management with JWT authentication - Image analysis via Gemini AI (NutriPhi backend) - Port 3316 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
111fc473d9
commit
57b9d4cb37
34 changed files with 3241 additions and 463 deletions
47
services/matrix-nutriphi-bot/Dockerfile
Normal file
47
services/matrix-nutriphi-bot/Dockerfile
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files (exclude pnpm-lock.yaml to use npm)
|
||||
COPY package.json ./
|
||||
|
||||
# Install dependencies using npm (more compatible with standard tooling)
|
||||
RUN npm install
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
# Build using TypeScript
|
||||
RUN rm -rf dist && npx tsc -p tsconfig.build.json
|
||||
|
||||
# Production stage
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Create data directory for bot storage
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# Copy package files
|
||||
COPY package.json ./
|
||||
|
||||
# Install production dependencies only
|
||||
RUN npm install --omit=dev
|
||||
|
||||
# Copy built files
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nestjs
|
||||
RUN chown -R nestjs:nodejs /app
|
||||
USER nestjs
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3316/health || exit 1
|
||||
|
||||
EXPOSE 3316
|
||||
|
||||
CMD ["node", "dist/main.js"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue