-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (34 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
44 lines (34 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Use the official Bun image with Debian base
FROM oven/bun:1.1.38
# Install Node.js 22 LTS (required by Prisma 7.0.1+)
# Remove any existing nodejs and install from official binaries
RUN apt-get update && \
apt-get install -y curl xz-utils && \
(apt-get remove -y nodejs 2>/dev/null || true) && \
curl -fsSL https://nodejs.org/dist/v22.12.0/node-v22.12.0-linux-x64.tar.xz -o /tmp/node.tar.xz && \
tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 && \
rm /tmp/node.tar.xz && \
node --version && \
npm --version && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json bun.lock ./
# Install dependencies
RUN bun install --frozen-lockfile
# Copy everything except node_modules (already installed)
COPY . .
# Generate Prisma client (ensure it's generated before app starts)
# DATABASE_URL is required by prisma.config.ts but not used during generation
RUN DATABASE_URL="postgresql://dummy:dummy@localhost:5432/dummy" bunx prisma generate
# Verify Prisma client was generated
RUN ls -la src/generated/prisma/ || (echo "Prisma client generation failed!" && exit 1)
# Expose port 3002
EXPOSE 3002
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3002
# Start the application
CMD bun run db:deploy && bun run src/index.ts