Skip to content

Commit f175233

Browse files
committed
Added build step to api Dockerfile to minimize the size
1 parent f77e83b commit f175233

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

api/Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
FROM node:18-alpine
1+
FROM node:18-alpine as builder
22
WORKDIR /app
33
COPY ./package.json ./
44
RUN npm install
55
COPY . .
66
RUN npm run build
7+
8+
FROM node:18-alpine
9+
WORKDIR /app
10+
COPY ./package.json ./
11+
RUN npm install --omit=dev
12+
COPY --from=builder /app/dist /dist
13+
714
CMD ["npm", "run", "start"]

0 commit comments

Comments
 (0)