mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 10:21:10 +02:00
Validator now checks 52 Dockerfiles (web + backend + service). Fixed 10 missing COPYs across backends, services, and nestjs-base. Generator also supports backend/service Dockerfiles with markers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
49 lines
1.2 KiB
Docker
49 lines
1.2 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM node:20-alpine AS base
|
|
|
|
# Install pnpm
|
|
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
|
|
|
WORKDIR /app
|
|
|
|
# Build stage
|
|
FROM base AS builder
|
|
|
|
# Copy workspace files
|
|
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./
|
|
COPY services/mana-notify/package.json ./services/mana-notify/
|
|
COPY packages/shared-drizzle-config/package.json ./packages/shared-drizzle-config/
|
|
|
|
# Install dependencies
|
|
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --filter @manacore/mana-notify
|
|
|
|
# Copy source code
|
|
COPY packages/shared-drizzle-config ./packages/shared-drizzle-config
|
|
COPY services/mana-notify ./services/mana-notify
|
|
|
|
# Build
|
|
WORKDIR /app/services/mana-notify
|
|
RUN pnpm build
|
|
|
|
# Production stage
|
|
FROM base AS production
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy built files
|
|
COPY --from=builder /app/services/mana-notify/dist ./dist
|
|
COPY --from=builder /app/services/mana-notify/package.json ./
|
|
|
|
# Copy template files
|
|
COPY --from=builder /app/services/mana-notify/src/templates/defaults ./dist/templates/defaults
|
|
|
|
# Install production dependencies only
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
# Set environment
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3040
|
|
|
|
EXPOSE 3040
|
|
|
|
CMD ["node", "dist/main.js"]
|