Skip to content

Commit

Permalink
Shrink docker image (#27)
Browse files Browse the repository at this point in the history
* Shrink docker image
* Add build deps for bigint-buffer
  • Loading branch information
jordy25519 authored Dec 5, 2024
1 parent 9e2e25b commit ae1eecc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM public.ecr.aws/bitnami/node:18
RUN apt-get install git
ENV NODE_ENV=production
RUN npm install -g typescript
FROM node:18 AS builder
RUN apt update -y && apt install git build-essential make python3 -y
RUN npm install -g typescript @vercel/ncc

ENV NODE_ENV=production
WORKDIR /app
COPY . .
WORKDIR /app/drift-common/protocol/sdk
Expand All @@ -14,7 +14,12 @@ RUN yarn build
WORKDIR /app
RUN yarn
RUN yarn build
RUN ncc build lib/index.js -o dist

FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/dist/ dist/
ENV NODE_ENV=production
EXPOSE 9464

CMD [ "yarn", "start" ]
CMD ["node", "./dist/index.js"]

0 comments on commit ae1eecc

Please sign in to comment.