-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (39 loc) · 1 KB
/
Dockerfile
File metadata and controls
50 lines (39 loc) · 1 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
45
46
47
48
49
50
##
# Builder stage: install dependencies and produce compiled artifacts.
##
FROM node:24 AS builder
WORKDIR /app
# Root dependencies (keep dev deps for build tooling)
COPY package*.json ./
RUN npm ci
# Server dependencies (needs dev deps for TypeScript)
WORKDIR /app/server
COPY server/package*.json ./
RUN npm ci
# Client dependencies (needs dev deps for Vite)
WORKDIR /app/client
COPY client/package*.json ./
RUN npm ci
# Copy the full source tree and build once.
WORKDIR /app
COPY . .
RUN npm run build
##
# Production stage: only runtime deps plus built assets.
##
FROM node:24-alpine AS production
ENV NODE_ENV=production
WORKDIR /app
# Root production dependencies.
COPY package*.json ./
RUN npm ci --omit=dev
# Server production dependencies.
WORKDIR /app/server
COPY server/package*.json ./
RUN npm ci --omit=dev
# Copy build outputs and any runtime assets.
WORKDIR /app
COPY --from=builder /app/server/build ./server/build
COPY --from=builder /app/client/dist ./client/dist
EXPOSE 5000
CMD ["npm", "start"]