diff --git a/Dockerfile b/Dockerfile index 554c9c7..0ad676c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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" ] \ No newline at end of file +CMD ["node", "./dist/index.js"] \ No newline at end of file