Skip to content

Commit 768a6f7

Browse files
authored
make docker size smaller
1 parent ac78faf commit 768a6f7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docker/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
# Using 18 alpine because supports arm/v8 and arm/v8 needed for silicon chips
2-
FROM node:18-alpine
2+
3+
# Builder stage with build tools
4+
FROM node:18-alpine AS builder
35
RUN apk add --no-cache bash python3 make g++
46
WORKDIR /app
57
ADD ./ .
68
RUN npm install
79
RUN npm run build
10+
11+
# Runtime stage - minimal
12+
FROM node:18-alpine
13+
RUN apk add --no-cache bash
14+
WORKDIR /app
15+
ADD ./ .
16+
COPY --from=builder /app/node_modules /app/node_modules
817
CMD ["npm", "start"]

0 commit comments

Comments
 (0)