mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:01:09 +02:00
chore: remove all NestJS backend references, replace with Hono/Bun
- Delete nestjs-backend.md guideline (replaced by hono-server.md) - Delete Dockerfile.nestjs-base and Dockerfile.nestjs templates - Delete stale BACKEND_ARCHITECTURE.md doc (NestJS-era, obsolete) - Update CLAUDE.md, GUIDELINES.md, authentication.md to Hono/Bun first - Update all app CLAUDE.md files: backend/ → server/, NestJS → Hono+Bun - Update all app package.json files: @*/backend → @*/server - Update docs: LOCAL_DEVELOPMENT, PORT_SCHEMA, ENVIRONMENT_VARIABLES, DATABASE_MIGRATIONS, MAC_MINI_SERVER, PROJECT_OVERVIEW - Update scripts: generate-env.mjs, setup-databases.sh, build-app.sh - Update CI/CD: cd-macmini.yml backend → server paths - Update Astro docs site: @chat/backend → @chat/server Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
708299b35e
commit
ab387b9b3d
43 changed files with 598 additions and 2398 deletions
|
|
@ -1,58 +0,0 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
# Shared builder base for all NestJS backends
|
||||
# Contains pre-built shared packages and dependencies
|
||||
#
|
||||
# Usage in backend Dockerfiles:
|
||||
# FROM nestjs-base:local AS builder
|
||||
# COPY apps/myapp/apps/backend ./apps/myapp/apps/backend
|
||||
# RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --ignore-scripts
|
||||
# WORKDIR /app/apps/myapp/apps/backend
|
||||
# RUN pnpm build
|
||||
|
||||
FROM node:20-alpine
|
||||
|
||||
# Install pnpm
|
||||
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy root workspace files
|
||||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Copy ALL shared packages used by NestJS backends
|
||||
COPY packages/credit-operations ./packages/credit-operations
|
||||
COPY packages/mana-core-nestjs-integration ./packages/mana-core-nestjs-integration
|
||||
COPY packages/manadeck-database ./packages/manadeck-database
|
||||
COPY packages/shared-drizzle-config ./packages/shared-drizzle-config
|
||||
COPY packages/shared-errors ./packages/shared-errors
|
||||
COPY packages/shared-error-tracking ./packages/shared-error-tracking
|
||||
COPY packages/shared-nestjs-auth ./packages/shared-nestjs-auth
|
||||
COPY packages/shared-nestjs-health ./packages/shared-nestjs-health
|
||||
COPY packages/shared-nestjs-metrics ./packages/shared-nestjs-metrics
|
||||
COPY packages/shared-nestjs-setup ./packages/shared-nestjs-setup
|
||||
COPY packages/shared-llm ./packages/shared-llm
|
||||
COPY packages/shared-storage ./packages/shared-storage
|
||||
COPY packages/shared-tsconfig ./packages/shared-tsconfig
|
||||
|
||||
# Install dependencies
|
||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
|
||||
pnpm install --frozen-lockfile --ignore-scripts
|
||||
|
||||
# Build all shared packages (in dependency order)
|
||||
RUN cd packages/shared-errors && pnpm build \
|
||||
&& cd /app/packages/shared-nestjs-auth && pnpm build \
|
||||
&& cd /app/packages/shared-nestjs-health && pnpm build \
|
||||
&& cd /app/packages/shared-nestjs-metrics && pnpm build \
|
||||
&& cd /app/packages/shared-nestjs-setup && pnpm build \
|
||||
&& cd /app/packages/shared-error-tracking && pnpm build \
|
||||
&& cd /app/packages/shared-storage && pnpm build \
|
||||
&& cd /app/packages/shared-llm && pnpm build \
|
||||
&& cd /app/packages/shared-drizzle-config && pnpm build 2>/dev/null || true \
|
||||
&& cd /app/packages/credit-operations && pnpm build \
|
||||
&& cd /app/packages/mana-core-nestjs-integration && pnpm build \
|
||||
&& cd /app/packages/manadeck-database && pnpm build 2>/dev/null || true
|
||||
|
||||
WORKDIR /app
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
# Multi-stage Dockerfile for NestJS backend services
|
||||
# This is a template - copy and customize for each backend service
|
||||
|
||||
# ============================================
|
||||
# Build Stage
|
||||
# ============================================
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
# Install pnpm
|
||||
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy workspace files
|
||||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json ./
|
||||
COPY pnpm-lock.yaml ./
|
||||
|
||||
# Copy all shared packages (adjust based on dependencies)
|
||||
COPY packages/ ./packages/
|
||||
|
||||
# Copy the specific backend service
|
||||
# CUSTOMIZE THIS: Replace with your service path
|
||||
# Example: COPY apps/chat/apps/backend ./apps/chat/apps/backend
|
||||
ARG SERVICE_PATH
|
||||
COPY ${SERVICE_PATH} ./${SERVICE_PATH}
|
||||
|
||||
# Install all dependencies (including devDependencies for build)
|
||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile
|
||||
|
||||
# Build shared packages first
|
||||
RUN pnpm run build:packages
|
||||
|
||||
# Build the backend service
|
||||
WORKDIR /app/${SERVICE_PATH}
|
||||
RUN pnpm build
|
||||
|
||||
# ============================================
|
||||
# Production Stage
|
||||
# ============================================
|
||||
FROM node:20-alpine AS production
|
||||
|
||||
# Install pnpm and system dependencies
|
||||
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate \
|
||||
&& apk add --no-cache \
|
||||
postgresql-client \
|
||||
curl \
|
||||
wget
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy workspace files
|
||||
COPY --from=builder /app/pnpm-workspace.yaml ./
|
||||
COPY --from=builder /app/package.json ./
|
||||
COPY --from=builder /app/pnpm-lock.yaml ./
|
||||
|
||||
# Copy built packages and service
|
||||
COPY --from=builder /app/packages ./packages
|
||||
ARG SERVICE_PATH
|
||||
COPY --from=builder /app/${SERVICE_PATH} ./${SERVICE_PATH}
|
||||
|
||||
# Install production dependencies only
|
||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --prod --frozen-lockfile
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup -g 1001 -S nodejs && \
|
||||
adduser -S nestjs -u 1001
|
||||
|
||||
# Change ownership
|
||||
RUN chown -R nestjs:nodejs /app
|
||||
|
||||
# Switch to non-root user
|
||||
USER nestjs
|
||||
|
||||
# Set working directory to service
|
||||
WORKDIR /app/${SERVICE_PATH}
|
||||
|
||||
# Expose port (customize per service)
|
||||
ARG PORT=3000
|
||||
EXPOSE ${PORT}
|
||||
|
||||
# Health check (customize endpoint per service)
|
||||
ARG HEALTH_PATH=/health
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT}${HEALTH_PATH} || exit 1
|
||||
|
||||
# Start the application
|
||||
CMD ["node", "dist/main.js"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue