managarten/services/matrix-stats-bot/Dockerfile
Till-JS 53653743f0 fix(matrix-bots): add --ignore-scripts to Dockerfiles
Skip postinstall scripts for matrix-sdk-crypto-nodejs which
doesn't build on Alpine Linux. E2E encryption not needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:42:11 +01:00

25 lines
878 B
Docker

FROM node:20-alpine AS builder
WORKDIR /app
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install --frozen-lockfile --ignore-scripts || pnpm install --ignore-scripts
COPY . .
RUN pnpm build
FROM node:20-alpine AS runner
WORKDIR /app
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
RUN mkdir -p /app/data
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install --prod --frozen-lockfile --ignore-scripts || pnpm install --prod --ignore-scripts
COPY --from=builder /app/dist ./dist
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nestjs
RUN chown -R nestjs:nodejs /app
USER nestjs
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3312/health || exit 1
EXPOSE 3312
CMD ["node", "dist/main.js"]