-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (36 loc) · 978 Bytes
/
Dockerfile
File metadata and controls
54 lines (36 loc) · 978 Bytes
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
45
46
47
48
49
50
51
52
53
54
# Build stage
FROM node:22-alpine AS builder
WORKDIR /app
# Enable corepack for yarn
RUN corepack enable
# Copy package files
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn ./.yarn
# Install dependencies
RUN yarn install --immutable
# Copy source code
COPY . .
# Generate Prisma client
RUN npx prisma generate
# Build application
RUN yarn build
# Production stage
FROM node:22-alpine AS production
WORKDIR /app
# Enable corepack for yarn
RUN corepack enable
# Copy package files
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn ./.yarn
# Install production dependencies only
RUN yarn workspaces focus --production
# Copy Prisma schema for client generation
COPY prisma ./prisma
# Generate Prisma client (use specific version to avoid compatibility issues)
RUN npx -y prisma@6.19.2 generate
# Copy built application
COPY --from=builder /app/dist ./dist
# Copy pubkey if exists (optional)
COPY pubkey.pem* ./
EXPOSE 3000
CMD ["node", "dist/main.js"]