@@ -4,9 +4,6 @@ FROM node:24-slim AS builder
44# Set working directory inside the container
55WORKDIR /app
66
7- # Set DATABASE_URL for Prisma (temporary for build, will be overridden at runtime)
8- ENV DATABASE_URL="file:/app/data/sqlite.db"
9-
107# Copy package files for better layer caching
118COPY package*.json ./
129
@@ -26,20 +23,14 @@ COPY src ./src/
2623# Build the TypeScript application
2724RUN npm run build
2825
29- # Compile seed file
30- RUN npx tsc prisma/seed.ts --outDir dist/prisma --target ES2020 --moduleResolution node --module esnext --esModuleInterop
31-
3226# Production stage
3327FROM node:24-slim
3428
35- # Install openssl for Prisma
29+ # Install openssl for Prisma (required for PostgreSQL)
3630RUN apt-get update -y && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
3731
3832WORKDIR /app
3933
40- # Set DATABASE_URL for Prisma (will be overridden by .env file at runtime)
41- ENV DATABASE_URL="file:/app/data/sqlite.db"
42-
4334# Copy package files
4435COPY package*.json ./
4536
@@ -55,11 +46,5 @@ RUN npx prisma generate
5546# Copy built application from builder stage
5647COPY --from=builder /app/dist ./dist
5748
58- # Create directory for SQLite database
59- RUN mkdir -p /app/data
60-
61- # Create SQLite database file
62- RUN touch /app/data/sqlite.db
63-
64- # Start the application with migrations and seeding
65- CMD ["sh" , "-c" , "npx prisma migrate deploy && node dist/prisma/seed.js && npm start" ]
49+ # Start the application with migrations
50+ CMD ["sh" , "-c" , "npx prisma migrate deploy && npm start" ]
0 commit comments