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:
38
backend/Dockerfile
Normal file
38
backend/Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user