Skip to content

Commit ae1eecc

Browse files
authored
Shrink docker image (#27)
* Shrink docker image * Add build deps for bigint-buffer
1 parent 9e2e25b commit ae1eecc

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM public.ecr.aws/bitnami/node:18
2-
RUN apt-get install git
3-
ENV NODE_ENV=production
4-
RUN npm install -g typescript
1+
FROM node:18 AS builder
2+
RUN apt update -y && apt install git build-essential make python3 -y
3+
RUN npm install -g typescript @vercel/ncc
54

5+
ENV NODE_ENV=production
66
WORKDIR /app
77
COPY . .
88
WORKDIR /app/drift-common/protocol/sdk
@@ -14,7 +14,12 @@ RUN yarn build
1414
WORKDIR /app
1515
RUN yarn
1616
RUN yarn build
17+
RUN ncc build lib/index.js -o dist
1718

19+
FROM node:18-alpine
20+
WORKDIR /app
21+
COPY --from=builder /app/dist/ dist/
22+
ENV NODE_ENV=production
1823
EXPOSE 9464
1924

20-
CMD [ "yarn", "start" ]
25+
CMD ["node", "./dist/index.js"]

0 commit comments

Comments
 (0)