File tree Expand file tree Collapse file tree 1 file changed +35
-11
lines changed Expand file tree Collapse file tree 1 file changed +35
-11
lines changed Original file line number Diff line number Diff line change 1
- FROM node:22-slim
1
+ # Build stage
2
+ FROM node:24-slim AS builder
2
3
3
4
# Set working directory
4
5
WORKDIR /app
5
6
6
- # Copy files
7
- COPY . .
7
+ # Copy package files for installation
8
+ COPY package*.json ./
9
+ COPY .npmrc ./
10
+ COPY client/package*.json ./client/
11
+ COPY server/package*.json ./server/
12
+ COPY cli/package*.json ./cli/
8
13
9
14
# Install dependencies
10
- # Working around https://github.com/npm/cli/issues/4828
11
- # RUN npm ci
12
- RUN npm install --no-package-lock
15
+ RUN npm ci --ignore-scripts
16
+
17
+ # Copy source files
18
+ COPY . .
13
19
14
20
# Build the application
15
21
RUN npm run build
16
22
17
- ARG CLIENT_PORT=6274
18
- ARG SERVER_PORT=6277
23
+ # Production stage
24
+ FROM node:24-slim
25
+
26
+ WORKDIR /app
27
+
28
+ # Copy package files for production
29
+ COPY package*.json ./
30
+ COPY .npmrc ./
31
+ COPY client/package*.json ./client/
32
+ COPY server/package*.json ./server/
33
+ COPY cli/package*.json ./cli/
34
+
35
+ # Install only production dependencies
36
+ RUN npm ci --omit=dev --ignore-scripts
37
+
38
+ # Copy built files from builder stage
39
+ COPY --from=builder /app/client/dist ./client/dist
40
+ COPY --from=builder /app/client/bin ./client/bin
41
+ COPY --from=builder /app/server/build ./server/build
42
+ COPY --from=builder /app/cli/build ./cli/build
19
43
20
- EXPOSE ${CLIENT_PORT} ${SERVER_PORT}
44
+ # Document which ports the application uses internally
45
+ EXPOSE 6274 6277
21
46
22
47
# Use ENTRYPOINT with CMD for arguments
23
- ENTRYPOINT ["npm" , "start" ]
24
- CMD []
48
+ ENTRYPOINT ["npm" , "start" ]
You can’t perform that action at this time.
0 commit comments