mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-28 15:37:44 +02:00
✨ feat(matrix-clock-bot): add Matrix bot for time tracking
- Add Docker build configuration with npm overrides for matrix-sdk - Update port from 3317 to 3318 to avoid conflict with Zitare bot - Add tsconfig.build.json for production builds - Add clock-bot service to docker-compose.macmini.yml - Bot supports timers, alarms, and world clocks via Matrix chat Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9a7afea7fe
commit
e2a3277fa1
7 changed files with 90 additions and 19 deletions
|
|
@ -1,25 +1,47 @@
|
|||
FROM node:20-alpine
|
||||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm
|
||||
# Copy package files (exclude pnpm-lock.yaml to use npm)
|
||||
COPY package.json ./
|
||||
|
||||
# Copy package files
|
||||
COPY package.json pnpm-lock.yaml* ./
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install --frozen-lockfile || pnpm install
|
||||
# Install dependencies using npm (more compatible with standard tooling)
|
||||
RUN npm install
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
# Build
|
||||
RUN pnpm build
|
||||
# Build using TypeScript
|
||||
RUN rm -rf dist && npx tsc -p tsconfig.build.json
|
||||
|
||||
# Create data directory
|
||||
# Production stage
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Create data directory for bot storage
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
EXPOSE 3317
|
||||
# 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:3318/health || exit 1
|
||||
|
||||
EXPOSE 3318
|
||||
|
||||
CMD ["node", "dist/main.js"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue