fix: update schema to fix multiple primary key issues and switch to node-postgres

- Replace primaryKey constraints with uniqueIndex where needed
- Fix schema for Auth, Contacts, Exchange Rates, Expense Participants, and Accounts tables
- Add missing import for uniqueIndex
- Switch from postgres.js to node-postgres (pg) for Drizzle
- Add proper type safety with TypeScript
- Add graceful shutdown of database connections
This commit is contained in:
2025-05-27 18:01:40 -04:00
parent 74b7ddf3d6
commit f9d5f8b404
17 changed files with 1618 additions and 25 deletions

38
backend/Dockerfile Normal file
View File

@@ -0,0 +1,38 @@
FROM oven/bun:1.2 as base
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json bun.lock ./
# Install dependencies
RUN bun install --frozen-lockfile
# Copy source code
COPY . .
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
# Expose port
EXPOSE 3000
# Start the application
CMD ["bun", "run", "start"]
# Development stage
FROM base as development
# Override environment variables for development
ENV NODE_ENV=development
# Start development server
CMD ["bun", "run", "dev"]
# Migration stage
FROM base as migration
# Run migrations
CMD ["bun", "run", "db:migrate"]