mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-27 20:57:43 +02:00
feat(nutriphi): migrate from Supabase to PostgreSQL + Hetzner S3
- Add nutriphi-database package with Drizzle ORM - meals and nutrition_goals schemas - PostgreSQL 16 Docker setup - Drizzle Kit configuration - Migrate backend from Supabase to Drizzle - Add DatabaseModule with connection pooling - Add StorageService for Hetzner Object Storage (S3-compatible) - Update MealsService with Drizzle queries - Add /api/meals/upload endpoint for image upload + analysis - Update web app to use backend for uploads - Remove Supabase Storage direct upload - Update uploadService to send images to backend - Remove Supabase dependencies from package.json - Simplify hooks.server.ts - Add Coolify deployment configuration - Dockerfile for production build - docker-compose.coolify.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ce71db2fc0
commit
6537863696
156 changed files with 15236 additions and 170 deletions
49
nutriphi/backend/Dockerfile
Normal file
49
nutriphi/backend/Dockerfile
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# Build stage
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
# Install pnpm
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy root workspace files
|
||||
COPY pnpm-workspace.yaml ./
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# Copy the nutriphi-database package
|
||||
COPY packages/nutriphi-database ./packages/nutriphi-database
|
||||
|
||||
# Copy the backend
|
||||
COPY nutriphi/backend ./nutriphi/backend
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install --frozen-lockfile --filter @nutriphi/backend...
|
||||
|
||||
# Build the database package first
|
||||
RUN pnpm --filter @manacore/nutriphi-database build
|
||||
|
||||
# Build the backend
|
||||
RUN pnpm --filter @nutriphi/backend build
|
||||
|
||||
# Production stage
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy built files
|
||||
COPY --from=builder /app/nutriphi/backend/dist ./dist
|
||||
COPY --from=builder /app/nutriphi/backend/package.json ./
|
||||
COPY --from=builder /app/nutriphi/backend/node_modules ./node_modules
|
||||
COPY --from=builder /app/packages/nutriphi-database/dist ./node_modules/@manacore/nutriphi-database/dist
|
||||
COPY --from=builder /app/packages/nutriphi-database/package.json ./node_modules/@manacore/nutriphi-database/
|
||||
|
||||
# Set environment
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3002
|
||||
|
||||
# Start the application
|
||||
CMD ["node", "dist/main.js"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue