mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 19:39:40 +02:00
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>
25 lines
878 B
Docker
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"]
|