- 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
38 lines
617 B
Docker
38 lines
617 B
Docker
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"] |