managarten/services/matrix-project-doc-bot/Dockerfile
Till-JS 8eac78599d fix(matrix-project-doc-bot): fix main.js path in Dockerfile
The dist output is at dist/src/main.js due to drizzle.config.ts at root level.

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

25 lines
882 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:3313/health || exit 1
EXPOSE 3313
CMD ["node", "dist/src/main.js"]