Skip to content

Commit

Permalink
chore: added multi-stage build
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienne-deriv committed Aug 1, 2024
1 parent d8d8252 commit 7ffbb82
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
FROM node:18 as base
FROM --platform=$BUILDPLATFORM node:18 as build

ARG BUILDPLATFORM=linux/arm64

WORKDIR /app

RUN git clone [email protected]:deriv-com/p2p.git && \
cd p2p && \
npm install && \
npm install -g serve && \
npm run build
ENV HUSKY=0

RUN git clone https://github.com/deriv-com/p2p.git .

RUN npm install

ENV NODE_ENV=production
RUN npm run build

FROM --platform=$BUILDPLATFORM node:lts-alpine3.20

RUN npm install -g serve

COPY --from=build /app/dist /dist

EXPOSE 4000

ENTRYPOINT ["serve"]

CMD ["-s", "p2p/dist", "-l", "4000"]
CMD ["-s", "dist", "-l", "4000"]

0 comments on commit 7ffbb82

Please sign in to comment.