-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 687 Bytes
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 687 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
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm install
# Copy source and build
COPY . .
RUN npx prisma generate
RUN npm run build
# Production stage
FROM node:20-alpine AS production
WORKDIR /app
# Copy package files and install production deps only
COPY package*.json ./
RUN npm install --omit=dev
# Copy Prisma schema and generate client
COPY prisma ./prisma
RUN npx prisma generate
# Copy built application
COPY --from=builder /app/dist ./dist
# Copy public folder for static frontend
COPY --from=builder /app/public ./public
# Expose port
EXPOSE 3000
# Start the application
CMD ["npm", "run", "start:prod"]